HomeFreeBSD

inpcb: reoder inpcb destruction

Description

inpcb: reoder inpcb destruction

First, merge in_pcbdetach() with in_pcbfree(). The comment for
in_pcbdetach() was no longer correct. Then, make sure we remove
the inpcb from the hash before we commit any destructive actions
on it. There are couple functions that rely on the hash lock
skipping SMR + inpcb lock to lookup an inpcb. Although there are
no known functions that similarly rely on the global inpcb list
lock, also do list removal before destructive actions.

PR: 273890
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43122
Approved by: so
Security: FreeBSD-EN-24:04.ip

(cherry picked from commit a13039e2709277b1c3b159e694cc909a5e044151)
(cherry picked from commit 2bfe735277b8858dd7ad937e0bf2286bdfb45182)

Details

Provenance
glebiusAuthored on Dec 27 2023, 4:34 PM
gordonCommitted on Feb 14 2024, 5:40 AM
Reviewer
markj
Differential Revision
D43122: inpcb: reoder inpcb destruction
Parents
rGbb06104dce0b: EVFILT_SIGNAL: do not use target process pointer on detach
Branches
Unknown
Tags
Unknown