HomeFreeBSD

pfsync: fix use of invalidated stack variable

Description

pfsync: fix use of invalidated stack variable

Calls to pfsync_send_plus() pass pointers to stack variables.
If pfsync_sendout() then fails it retains the pointer to these stack
variables, accesing them later.

Allocate a buffer and copy the data instead, so that we can retain the
pointer safely.

Reported by: CI KASAN, markj
MFC after: 1 week

(cherry picked from commit 81debbd60e5773e812e9227a2003ea88699580be)

Details

Provenance
kpAuthored on Mar 24 2024, 8:46 AM
Parents
rG2fed983ceb66: pf: fix use-after-free
Branches
Unknown
Tags
Unknown