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
Sponsored by: The FreeBSD Foundation

(cherry picked from commit dfcef8771484271f2bccdb1dbc088a838441c5a7)

Details

Provenance
markjAuthored on Sep 17 2021, 4:26 PM
Parents
rGe68465ecbf73: uma: Show the count of free slabs in each per-domain keg's sysctl tree
Branches
Unknown
Tags
Unknown