Date: Thu, 24 May 2018 18:22:05 +0000 (UTC) From: Matt Macy <mmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334174 - head/sys/kern Message-ID: <201805241822.w4OIM5GD026433@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mmacy Date: Thu May 24 18:22:05 2018 New Revision: 334174 URL: https://svnweb.freebsd.org/changeset/base/334174 Log: AF_UNIX in connectat unp and unp2 can be the same Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu May 24 18:02:02 2018 (r334173) +++ head/sys/kern/uipc_usrreq.c Thu May 24 18:22:05 2018 (r334174) @@ -1610,14 +1610,18 @@ unp_connectat(int fd, struct socket *so, struct sockad mac_socketpeer_set_from_socket(so, so2); mac_socketpeer_set_from_socket(so2, so); #endif - } else - unp_pcb_lock2(unp, unp2); - + } else { + if (unp == unp2) + UNP_PCB_LOCK(unp); + else + unp_pcb_lock2(unp, unp2); + } KASSERT(unp2 != NULL && so2 != NULL && unp2->unp_socket == so2 && sotounpcb(so2) == unp2, ("%s: unp2 %p so2 %p", __func__, unp2, so2)); error = unp_connect2(so, so2, PRU_CONNECT); - UNP_PCB_UNLOCK(unp2); + if (unp != unp2) + UNP_PCB_UNLOCK(unp2); UNP_PCB_UNLOCK(unp); bad2: mtx_unlock(vplock);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805241822.w4OIM5GD026433>