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, May 24, 3:40 AM
Unknown Object (File)
Sat, May 16, 1:16 PM
Unknown Object (File)
Mon, May 11, 3:44 PM
Unknown Object (File)
Mon, May 11, 5:19 AM
Unknown Object (File)
Mon, May 11, 5:19 AM
Unknown Object (File)
Mon, May 11, 3:57 AM
Unknown Object (File)
Apr 15 2026, 5:00 PM
Unknown Object (File)
Apr 11 2026, 9:51 PM
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