diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-02-28 08:08:50 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-02-28 08:08:50 +0000 |
commit | 9408f478d22bcbd7c126b4f1923941a4d114edd3 (patch) | |
tree | 1e0dc75e44452e15842ae62ad2b2fe2e8bce56c9 | |
parent | 54c3432baa3b9ac24b33493587afae858fd89d15 (diff) | |
download | FreeBSD-src-9408f478d22bcbd7c126b4f1923941a4d114edd3.zip FreeBSD-src-9408f478d22bcbd7c126b4f1923941a4d114edd3.tar.gz |
Lock unp2 after checking for a non-NULL unp2 pointer in uipc_send() on
datagram UNIX domain sockets, not before.
-rw-r--r-- | sys/kern/uipc_usrreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |