summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2013-03-19 20:07:14 +0000
committerbluhm <bluhm@openbsd.org>2013-03-19 20:07:14 +0000
commit4291a85a4d4b7e98662f0efa6874ba719eb5976c (patch)
tree3dee999d70d630fde645de8914221a1fcf0c146e
parentNote that ruby 1.8 is the current default for non-gem or extconf (diff)
downloadwireguard-openbsd-4291a85a4d4b7e98662f0efa6874ba719eb5976c.tar.xz
wireguard-openbsd-4291a85a4d4b7e98662f0efa6874ba719eb5976c.zip
After a socket splicing timeout is fired, a network interrupt can
unsplice() the sockets before soidle() goes to splsoftnet. In this case, unsplice() was called twice. So check wether splicing still exists within the splsoftnet protection. Uvm fault in sounsplice() reported by keith at scott-land dot net. OK claudio@
-rw-r--r--sys/kern/uipc_socket.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 150333a51d4..95ffd2b2fe6 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.114 2013/02/16 14:34:52 bluhm Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.115 2013/03/19 20:07:14 bluhm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -1443,8 +1443,10 @@ soidle(void *arg)
int s;
s = splsoftnet();
- so->so_error = ETIMEDOUT;
- sounsplice(so, so->so_splice, 1);
+ if (so->so_splice) {
+ so->so_error = ETIMEDOUT;
+ sounsplice(so, so->so_splice, 1);
+ }
splx(s);
}
#endif /* SOCKET_SPLICE */