summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_socket.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-11-22 12:11:38 +0000
committermpi <mpi@openbsd.org>2016-11-22 12:11:38 +0000
commit906cf29e67db38eba486452b4ff5dcbb41791fc1 (patch)
treeeb63eaa26d3afea6d5c7792a4b2897463c36aac7 /sys/kern/sys_socket.c
parentInsert disabled VMs into vmd(8)'s queues and allow vmctl(8) to display them. (diff)
downloadwireguard-openbsd-906cf29e67db38eba486452b4ff5dcbb41791fc1.tar.xz
wireguard-openbsd-906cf29e67db38eba486452b4ff5dcbb41791fc1.zip
Enforce that ifioctl() is called at IPL_SOFTNET.
This will allow us to keep locking simple as soon as we trade splsoftnet() for a rwlock. ok bluhm@
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r--sys/kern/sys_socket.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index e824d9e132e..a7a4113a4b2 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_socket.c,v 1.24 2016/11/21 10:30:42 mpi Exp $ */
+/* $OpenBSD: sys_socket.c,v 1.25 2016/11/22 12:11:38 mpi Exp $ */
/* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */
/*
@@ -119,8 +119,12 @@ soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p)
* interface and routing ioctls should have a
* different entry since a socket's unnecessary
*/
- if (IOCGROUP(cmd) == 'i')
- return (ifioctl(so, cmd, data, p));
+ if (IOCGROUP(cmd) == 'i') {
+ s = splsoftnet();
+ error = ifioctl(so, cmd, data, p);
+ splx(s);
+ return (error);
+ }
if (IOCGROUP(cmd) == 'r')
return (EOPNOTSUPP);
s = splsoftnet();