From 9408f478d22bcbd7c126b4f1923941a4d114edd3 Mon Sep 17 00:00:00 2001 From: rwatson Date: Wed, 28 Feb 2007 08:08:50 +0000 Subject: 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 23a16b0..3a30138 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; -- cgit v1.1