HomeFreeBSD

if_pfsync: lock buckets during pfsync_drop()

Description

if_pfsync: lock buckets during pfsync_drop()

We failed to lock buckets while dropping messages, which could potentially lead
to crashes, and is the likely cause of panics like:

pfsync_drop: st->sync_state == q

  1. pfsync_drop
  2. pfsync_q_ins
  3. pfsync_insert_state
  4. pf_state_insert

...

Handle this by only handling the currently relevant (and this locked) bucket.
This ensures that the bucket is locked while we manipulate it.
While here also log slightly more information in the KASSERT().

MFC after: 2 weeks
Sponsored by: Orange Business Services

(cherry picked from commit 5f75cd390a67cbec06993c4c66f784f0f777c854)

Details

Provenance
kpAuthored on Jul 7 2024, 2:42 PM
Parents
rGdd0bb5ba4257: cxgbe(4): Do not report link state change during interface detach.
Branches
Unknown
Tags
Unknown