]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pfsync: fix pfsync_undefer_state() locking
authorKristof Provost <kp@FreeBSD.org>
Mon, 20 Mar 2023 13:29:55 +0000 (14:29 +0100)
committerKristof Provost <kp@FreeBSD.org>
Mon, 27 Mar 2023 08:16:03 +0000 (10:16 +0200)
commit44af4103e422029026e9bb1a5784550365831cf3
treea3b9fe90e77d37e95aeb6d7d8732020999cc1ea5
parent6dace6a5cc84644668a66d58502b779243a666f0
pfsync: fix pfsync_undefer_state() locking

pfsync_undefer_state() takes the bucket lock, but could get called from
places (e.g. from pfsync_update_state() or pfsync_delete_state()) where
we already held the lock.

As it can also be called from places where we don't yet hold the lock
create new locked variant for use when the lock is already held. Keep
using pfsync_undefer_state() where the lock must still be taken.

PR: 268246
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (Netgate)

(cherry picked from commit 53247cdf12449e90f6736ae563e4cce8315c923f)
sys/netpfil/pf/if_pfsync.c