summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2012-09-19 20:00:32 +0000
committerbluhm <bluhm@openbsd.org>2012-09-19 20:00:32 +0000
commitbddf6fda44a4bc6e9a7a7dc2b96a3e511a436256 (patch)
treea396b6d2b33d37d8baddf3badfbf8439373ad226
parentIn somove() make the call to pr_usrreq(PRU_RCVD) under the same (diff)
downloadwireguard-openbsd-bddf6fda44a4bc6e9a7a7dc2b96a3e511a436256.tar.xz
wireguard-openbsd-bddf6fda44a4bc6e9a7a7dc2b96a3e511a436256.zip
When a socket is spliced, it may not wakeup the userland for reading.
There was a small race in sorwakeup() where that could happen if we slept before the SB_SPLICE flag was set. ok claudio@
-rw-r--r--sys/kern/uipc_socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index ff2a79bcf35..6724bd4aaca 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.106 2012/09/19 19:41:29 bluhm Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.107 2012/09/19 20:00:32 bluhm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -1337,10 +1337,10 @@ void
sorwakeup(struct socket *so)
{
#ifdef SOCKET_SPLICE
- if (so->so_rcv.sb_flags & SB_SPLICE) {
+ if (so->so_rcv.sb_flags & SB_SPLICE)
(void) somove(so, M_DONTWAIT);
+ if (so->so_splice)
return;
- }
#endif
sowakeup(so, &so->so_rcv);
if (so->so_upcall)