On Thu, 09 Feb 2017 08:27:51 -0700, "Todd C. Miller" wrote: > On Thu, 09 Feb 2017 12:36:44 +0100, Martin Pieuchot wrote: > > > dtucker@ reported an interesting recursion [0]. His trace shows that > > a thread executing unp_detach() MUST NOT be holding the NET_LOCK(). > > > > So here's a new version of my SOCKET_LOCK() diff that does exactly > > that. That means sofree(9) won't grab the NET_LOCK() for unix sockets > > which makes uipc_usrreq() completely NET_LOCK() free. > > The NET_ASSERT_UNLOCKED() in the PRU_BIND case in uipc_usrreq() > appears to be superfluous since you've added an assert before the > switch() too.
Also, since unp_connect() is only called via uipc_usrreq() there is no need for NET_ASSERT_UNLOCKED() in unp_connect(). - todd
