HomeFreeBSD

pf: improve pf_state_key_attach() error handling

Description

pf: improve pf_state_key_attach() error handling

If we fail to attach the stack key that means we've already attached the wire
key. That means the state could be found by other cores, and given that we then
free it, be used after free.
Fix this by not releasing the ID hashrow lock and key locks until after we've
removed the inserted key again, ensuring the state cannot be found by other
cores.

Reported by: markj
Submitted by: glebius
Reviewed by: glebius, markj
MFC after: 3 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D49550

Details

Provenance
kpAuthored on Thu, Mar 27, 2:21 PM
Reviewer
glebius
Differential Revision
D49550: pf: improve pf_state_key_attach() error handling
Parents
rG2ad0f7e91582: Import iwx as ported from OpenBSD by Future Crew.
Branches
Unknown
Tags
Unknown