summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_usrreq.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2016-07-18 06:09:52 +0000
committertruckman <truckman@FreeBSD.org>2016-07-18 06:09:52 +0000
commit8a82654af3aa5b65efa78b88f4ad933019153887 (patch)
tree3038545c120d0bdefa08a76b41030f37d4841949 /sys/netinet/tcp_usrreq.c
parent204e0ef37ba4de4782f59a62f5cbea54c4474a5f (diff)
downloadFreeBSD-src-8a82654af3aa5b65efa78b88f4ad933019153887.zip
FreeBSD-src-8a82654af3aa5b65efa78b88f4ad933019153887.tar.gz
MFC r302667
Fix problems in the FQ-PIE AQM cleanup code that could leak memory or cause a crash. Because dummynet calls pie_cleanup() while holding a mutex, pie_cleanup() is not able to use callout_drain() to make sure that all callouts are finished before it returns, and callout_stop() is not sufficient to make that guarantee. After pie_cleanup() returns, dummynet will free a structure that any remaining callouts will want to access. Fix these problems by allocating a separate structure to contain the data used by the callouts. In pie_cleanup(), call callout_reset_sbt() to replace the normal callout with a cleanup callout that does the cleanup work for each sub-queue. The instance of the cleanup callout that destroys the last flow will also free the extra allocated block of memory. Protect the reference count manipulation in the cleanup callout with DN_BH_WLOCK() to be consistent with all of the other usage of the reference count where this lock is held by the dummynet code. Submitted by: Rasool Al-Saadi <ralsaadi@swin.edu.au> Differential Revision: https://reviews.freebsd.org/D7174
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud