diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-11-22 12:11:39 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2016-11-22 12:11:39 +0000 |
commit | 8314bfaf4cc9e01b152b3aeebd4f9093ea73b731 (patch) | |
tree | 1401f83b94e2977038a4fbee7ca8f2c74af80b3d /sys/kern | |
parent | 0c891e89267cbeabdff8ebf8ed0629f4fb875835 (diff) |
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')
-rw-r--r-- | sys/kern/sys_socket.c | 10 |
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(); |