Page MenuHomeFreeBSD

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

Authored by markj on Sep 15 2021, 7:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 11:13 AM
Unknown Object (File)
Sun, Oct 12, 11:13 AM
Unknown Object (File)
Sun, Oct 12, 11:13 AM
Unknown Object (File)
Sun, Oct 12, 12:22 AM
Unknown Object (File)
Mon, Sep 29, 3:13 AM
Unknown Object (File)
Sep 10 2025, 12:54 AM
Unknown Object (File)
Aug 15 2025, 12:30 AM
Unknown Object (File)
Aug 13 2025, 8:35 AM
Subscribers

Details

Summary

After releasing a 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: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable