HomeFreeBSD

unix: Fix a use-after-free in unp_drop()

Description

unix: Fix a use-after-free in unp_drop()

We need to load the socket pointer after locking the PCB, otherwise
the socket may have been detached and freed by the time that unp_drop()
sets so_error.

This previously went unnoticed as the socket zone was _NOFREE.

Reported by: pho
MFC after: 1 week

Details

Provenance
markjAuthored on Sep 18 2021, 2:38 PM
Parents
rG8e496ea1df1f: pf: always log nat rule and do it pre-rewrite
Branches
Unknown
Tags
Unknown