HomeFreeBSD

pfsync: add missing unlock in pfsync_defer_tmo()

Description

pfsync: add missing unlock in pfsync_defer_tmo()

The callout for pfsync_defer_tmo() is created with
CALLOUT_RETURNUNLOCKED, because while the callout framework takes care
of taking the lock we want to run a few operations outside of the lock,
so we unlock ourselves.

However, if sc->sc_sync_if == NULL we return without releasing the
lock, and leak the lock, causing later deadlocks.
Ensure we always release the bucket lock when we exit pfsync_defer_tmo()

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

(cherry picked from commit 844ad2828a35c434b893af4274b1f6c50332dd70)

Details

Provenance
kpAuthored on Mar 20 2023, 1:26 PM
Parents
rG44af4103e422: pfsync: fix pfsync_undefer_state() locking
Branches
Unknown
Tags
Unknown