]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Handle races with listening socket close when connecting a unix socket.
authormarkj <markj@FreeBSD.org>
Mon, 8 Aug 2016 20:25:04 +0000 (20:25 +0000)
committermarkj <markj@FreeBSD.org>
Mon, 8 Aug 2016 20:25:04 +0000 (20:25 +0000)
commitcfea0efd4a37a33ab3e4055bfe59ee6392277e6b
treea6e93970f76f6769227434d9eda15ab03f9d7ebb
parent7602bc08a89530415b30dfa1882c8c514f45ec90
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
sys/kern/uipc_usrreq.c
sys/sys/unpcb.h