HomeFreeBSD

Handle races with listening socket close when connecting a unix socket.

Description

Handle races with listening socket close when connecting a unix socket.

If the listening socket is closed while sonewconn() is executing, the
nascent child socket is aborted, which results in recursion on the
unp_link lock when the child's pru_detach method is invoked. Fix this
by using a flag to mark such sockets, and skip a part of the socket's
teardown during detach.

Reported by: Raviprakash Darbha <rdarbha@juniper.net>
Tested by: pho
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D7398

Details

Provenance
markjAuthored on
Differential Revision
D7398: Recursive lock panic of UNP_LINK_WLOCK
Parents
rS303854: MFC r303729:
Branches
Unknown
Tags
Unknown