]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r292254:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 24 Mar 2016 09:22:58 +0000 (09:22 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 24 Mar 2016 09:22:58 +0000 (09:22 +0000)
commitf499c22e110be90cdd4d850c0505a79dde59eb2e
treeb90853e4274e9b1ab7ff0afbb6ddf8737e294c7b
parentb2397c0e07ff792d9dfe6807dc7d1fea7d2e3340
MFC r292254:

Properly drain callouts in the IPFW subsystem to avoid use after free
panics when unloading the dummynet and IPFW modules:

- The callout drain function can sleep and should not be called having
a non-sleepable lock locked. Remove locks around "ipfw_dyn_uninit(0)".

- Add a new "dn_gone" variable to prevent asynchronous restart of
dummynet callouts when unloading the dummynet kernel module.

- Call "dn_reschedule()" locked so that "dn_gone" can be set and
checked atomically with regard to starting a new callout.

PR: 208171
Requested by: Franco Fichtner (opnsense.org)
Differential Revision: https://reviews.freebsd.org/D3855

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