HomeFreeBSD

socket: Fix a use-after-free in soclose()

Description

socket: Fix a use-after-free in soclose()

After releasing the fd reference to a socket "so", we should avoid
testing SOLISTENING(so) since the socket may have been freed. Instead,
directly test whether the list of unaccepted sockets is empty.

Fixes: f4bb1869ddd2 ("Consistently use the SOLISTENING() macro")
Pointy hat: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31973

Details

Provenance
markjAuthored on Sep 17 2021, 4:26 PM
Differential Revision
D31973: socket: Fix a use-after-free in soclose()
Parents
rGbf25678226f0: ktls: Fix error/mode confusion in TCP_*TLS_MODE getsockopt handlers
Branches
Unknown
Tags
Unknown