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.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31974

Details

Provenance
markjAuthored on Sep 17 2021, 4:26 PM
Differential Revision
D31974: socket: Add assertions around naked refcount decrements
Parents
rGdfcef8771484: socket: Fix a use-after-free in soclose()
Branches
Unknown
Tags
Unknown