]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r302338
authortruckman <truckman@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 8 Jul 2016 02:52:39 +0000 (02:52 +0000)
committertruckman <truckman@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 8 Jul 2016 02:52:39 +0000 (02:52 +0000)
commitd1eabbf235ee13a4b2e38637baa7e31e3a637856
tree025656ac452dd9ecdab3028919d6fe43e3b5ef9d
parent2a149c26b3bcbb600f0226d5e49310ff4f3881b3
MFC r302338

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>
Differential Revision: https://reviews.freebsd.org/D6928

git-svn-id: svn://svn.freebsd.org/base/stable/10@302422 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/netpfil/ipfw/dn_aqm_pie.c