summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2015-08-24 14:28:25 +0000
committerbluhm <bluhm@openbsd.org>2015-08-24 14:28:25 +0000
commit0c592296fa22fb0fe71723c7128aa5fd1ffd7651 (patch)
tree1f29404123a40208e39e19fcc8eb4c49861fd82b
parentIn kernel initialize struct sockaddr_in and sockaddr_in6 to zero (diff)
downloadwireguard-openbsd-0c592296fa22fb0fe71723c7128aa5fd1ffd7651.tar.xz
wireguard-openbsd-0c592296fa22fb0fe71723c7128aa5fd1ffd7651.zip
Items from pool sosplice_pool are get in process context and put
in soft interrupt. So the pool needs an IPL_SOFTNET protection. This fixes a panic: mtx_enter: locking against myself. While there, call pool_setipl() also for socket_pool. Although this pool uses explicit spl protection around pool_get() and pool_put(), it is better to specify the IPL it is operating on. OK mpi@ mikeb@
-rw-r--r--sys/kern/uipc_socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index cc8b477c3e3..379020389cb 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.141 2015/07/08 07:21:50 mpi Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.142 2015/08/24 14:28:25 bluhm Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -86,11 +86,12 @@ struct pool sosplice_pool;
void
soinit(void)
{
-
pool_init(&socket_pool, sizeof(struct socket), 0, 0, 0, "sockpl", NULL);
+ pool_setipl(&socket_pool, IPL_SOFTNET);
#ifdef SOCKET_SPLICE
pool_init(&sosplice_pool, sizeof(struct sosplice), 0, 0, 0, "sosppl",
NULL);
+ pool_setipl(&sosplice_pool, IPL_SOFTNET);
#endif
}