summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2013-03-19 20:07:15 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2013-03-19 20:07:15 +0000
commita51537b8b8cef30a82bcde54cb256264c070ebfe (patch)
tree00c6b65cf1346f1ce3b924a58f18a4698b72ad30 /sys
parentcebd6c1ebba5dd691d3e73fbf6bb58747c0e2c77 (diff)
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@
Diffstat (limited to 'sys')
-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 */