diff options
author | kp <kp@FreeBSD.org> | 2017-03-12 05:00:04 +0000 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2017-07-17 20:11:35 -0500 |
commit | 01a42e5ccbe9da9543ec7e34ff2d7f0343fe083b (patch) | |
tree | 2e0c805035d6d84b00259c2106c90ae146b783e4 | |
parent | e7e8f23777fb5195194960fa2292687405eafb6f (diff) | |
download | FreeBSD-src-01a42e5ccbe9da9543ec7e34ff2d7f0343fe083b.zip FreeBSD-src-01a42e5ccbe9da9543ec7e34ff2d7f0343fe083b.tar.gz |
pf: Do not lose the VNET lock when ending the purge thread
When the pf_purge_thread() exits it must make sure to release the
VNET_LIST_RLOCK it still holds.
kproc_exit() does not return.
(cherry picked from commit e68f488f373abc3c59a19200bb1779762c3f9e03)
-rw-r--r-- | sys/netpfil/pf/pf.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 3ac1c8b..356e802 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1599,11 +1599,12 @@ pf_purge_thread(void *unused __unused) VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - if (pf_end_threads) { - pf_end_threads++; - wakeup(pf_purge_thread); - kproc_exit(0); - } + if (pf_end_threads) { + pf_end_threads++; + wakeup(pf_purge_thread); + VNET_LIST_RUNLOCK(); + kproc_exit(0); + } /* Wait while V_pf_default_rule.timeout is initialized. */ if (V_pf_vnet_active == 0) { |