HomeFreeBSD

socket: Add assertions around naked refcount decrements

Description

socket: Add assertions around naked refcount decrements

Sockets in a listen queue hold a reference to the parent listening
socket. Several code paths release this reference manually when moving
a child socket out of the queue.

Replace comments about the expected post-decrement refcount value with
assertions. Use refcount_load() instead of a plain load. No functional
change intended.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 6b288408ca32e68c74f6ab12324448ab4862a045)

Details

Provenance
markjAuthored on Sep 17 2021, 4:26 PM
Parents
rGe9e4f8092c2e: socket: Fix a use-after-free in soclose()
Branches
Unknown
Tags
Unknown