freebsd-nq/sys/netpfil/ipfw
Don Lewis 12be18c7d5 Fix a race condition between the main thread in aqm_pie_cleanup() and the
callout thread that can cause a kernel panic.  Always do the final cleanup
in the callout thread by passing a separate callout function for that task
to callout_reset_sbt().

Protect the ref_count decrement in the callout with DN_BH_WLOCK().  All
other ref_count manipulation is protected with this lock.

There is still a tiny window between ref_count reaching zero and the end
of the callout function where it is unsafe to unload the module.  Fixing
this would require the use of callout_drain(), but this can't be done
because dummynet holds a mutex and callout_drain() might sleep.

Remove the callout_pending(), callout_active(), and callout_deactivate()
calls from calculate_drop_prob().  They are not needed because this callout
uses callout_init_mtx().

Submitted by:	Rasool Al-Saadi <ralsaadi@swin.edu.au>
Approved by:	re (gjb)
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D6928
2016-07-05 00:53:01 +00:00
..
test cleanup and document in some detail the internals of the testing code 2016-01-27 02:22:31 +00:00
dn_aqm_codel.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_aqm_codel.h Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_aqm_pie.c Fix a race condition between the main thread in aqm_pie_cleanup() and the 2016-07-05 00:53:01 +00:00
dn_aqm_pie.h Replace constant expressions that contain multiplications by 2016-06-01 20:04:24 +00:00
dn_aqm.h Correct a typo in a comment. 2016-05-26 22:03:28 +00:00
dn_heap.c avoid warnings for signed/unsigned comparison and unused arguments 2016-01-26 22:45:05 +00:00
dn_heap.h sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
dn_sched_fifo.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_fq_codel_helper.h Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_fq_codel.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_fq_codel.h Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_fq_pie.c Replace constant expressions that contain multiplications by 2016-06-01 20:04:24 +00:00
dn_sched_prio.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_qfq.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_rr.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched_wf2q.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
dn_sched.h Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
dummynet.txt sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
ip_dn_glue.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
ip_dn_io.c Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
ip_dn_private.h Import Dummynet AQM version 0.2.1 (CoDel, FQ-CoDel, PIE and FQ-PIE). 2016-05-26 21:40:13 +00:00
ip_dummynet.c Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
ip_fw2.c Move the ipfw_log_bpf() calls from global module initialisation to 2016-06-30 01:33:14 +00:00
ip_fw_dynamic.c Fix the regression introduced in r300143. 2016-05-20 15:00:12 +00:00
ip_fw_eaction.c Make named objects set-aware. Now it is possible to create named 2016-05-17 07:47:23 +00:00
ip_fw_iface.c Change the type of objhash_cb_t callback function to be able return an 2016-05-06 03:18:51 +00:00
ip_fw_log.c Move the ipfw_log_bpf() calls from global module initialisation to 2016-06-30 01:33:14 +00:00
ip_fw_nat.c In case of the global eventhandler make sure the current VNET 2016-06-30 19:32:45 +00:00
ip_fw_pfil.c use proper types to represent function pointers 2015-05-19 16:51:30 +00:00
ip_fw_private.h Make named objects set-aware. Now it is possible to create named 2016-05-17 07:47:23 +00:00
ip_fw_sockopt.c Make named objects set-aware. Now it is possible to create named 2016-05-17 07:47:23 +00:00
ip_fw_table_algo.c Fix 4-byte overflow in ipv6_writemask. 2016-06-05 10:33:53 +00:00
ip_fw_table_value.c Change the type of objhash_cb_t callback function to be able return an 2016-05-06 03:18:51 +00:00
ip_fw_table.c Make named objects set-aware. Now it is possible to create named 2016-05-17 07:47:23 +00:00
ip_fw_table.h Add ipfw_check_object_name_generic() function to do basic checks for an 2015-11-03 10:29:46 +00:00