summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_socket.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-01-25 21:59:41 +0000
committermpi <mpi@openbsd.org>2017-01-25 21:59:41 +0000
commit2201f6252299d5b4521351c1d77e90059066d08d (patch)
tree3fcd70c668b0f1919aee44ca48b97c756132b273 /sys/kern/sys_socket.c
parentAdd infrastructure to build LLVM for mips64. (diff)
downloadwireguard-openbsd-2201f6252299d5b4521351c1d77e90059066d08d.tar.xz
wireguard-openbsd-2201f6252299d5b4521351c1d77e90059066d08d.zip
Introduce a hack to remove false-positives when looking for memory
allocation that can sleep while holding the NET_LOCK(). To be removed once we're confident the remaining code paths are safe. Discussed with deraadt@
Diffstat (limited to 'sys/kern/sys_socket.c')
-rw-r--r--sys/kern/sys_socket.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c
index 7c8d8f728d1..7a54f093206 100644
--- a/sys/kern/sys_socket.c
+++ b/sys/kern/sys_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_socket.c,v 1.26 2016/12/19 08:36:49 mpi Exp $ */
+/* $OpenBSD: sys_socket.c,v 1.27 2017/01/25 21:59:41 mpi Exp $ */
/* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */
/*
@@ -121,7 +121,14 @@ soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p)
*/
if (IOCGROUP(cmd) == 'i') {
NET_LOCK(s);
+#if 1
+ extern int inifioctl;
+ inifioctl = 1;
+#endif
error = ifioctl(so, cmd, data, p);
+#if 1
+ inifioctl = 0;
+#endif
NET_UNLOCK(s);
return (error);
}