From 3592fd4de5a3283a94d9e482d6960cbf3b72c790 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Wed, 28 Feb 2007 08:08:50 +0000 Subject: [PATCH] Lock unp2 after checking for a non-NULL unp2 pointer in uipc_send() on datagram UNIX domain sockets, not before. --- sys/kern/uipc_usrreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 23a16b091541..3a30138e6985 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -800,11 +800,11 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, * correct error that the socket is not connected. */ UNP_PCB_LOCK_ASSERT(unp); - UNP_PCB_LOCK(unp2); if (unp2 == NULL) { error = ENOTCONN; break; } + UNP_PCB_LOCK(unp2); so2 = unp2->unp_socket; if (unp->unp_addr != NULL) from = (struct sockaddr *)unp->unp_addr;