mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
pf: leave the epoch to purge unlinked rules
pf_purge_thread() calls pf_purge_unlinked_rules() in the network
epoch, where sleeping is not allowed, and it takes pf_config_lock, an
sx lock. If a rule is being added at the time, the purge thread
can sleep on the lock, which panics with INVARIANTS.
Reviewed by: kp
Approved by: kp (mentor)
Fixes: f92d9b1aad ("pflow: import from OpenBSD")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D60160
This commit is contained in:
1 file changed
+6
@@ -2935,7 +2935,13 @@ pf_purge_thread(void *unused __unused)
|
||||
*/
|
||||
pf_purge_expired_fragments();
|
||||
pf_purge_expired_src_nodes();
|
||||
/*
|
||||
* Takes the config lock, and may have to
|
||||
* sleep for it.
|
||||
*/
|
||||
NET_EPOCH_EXIT(et);
|
||||
pf_purge_unlinked_rules();
|
||||
NET_EPOCH_ENTER(et);
|
||||
pf_source_purge();
|
||||
pfi_kkif_purge();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user