summaryrefslogtreecommitdiffstats
path: root/sys/sys/conf.h
diff options
context:
space:
mode:
authormikeb <mikeb@openbsd.org>2011-10-06 09:14:35 +0000
committermikeb <mikeb@openbsd.org>2011-10-06 09:14:35 +0000
commit556fc1856a4642dbd1e91964d4e9bc576544cb80 (patch)
tree4307cc07cc484974d235207077085e115668ebe6 /sys/sys/conf.h
parentrc_reload is valid here. (diff)
downloadwireguard-openbsd-556fc1856a4642dbd1e91964d4e9bc576544cb80.tar.xz
wireguard-openbsd-556fc1856a4642dbd1e91964d4e9bc576544cb80.zip
Introduce a kqfilter wrapper for the controlling tty device entry
which allows a correct registration of kqueue(2) notifications on the /dev/tty instead of calling a function via a null pointer in the ttkqfilter leading to a local DoS. Surprisingly the same code is present in NetBSD since the kqueue merge, but didn't make it to the OpenBSD for 10 years. Thanks to Anton Yabchinskiy <arn-at-bestmx-dot-ru> for a GHCi crash report and his willingness to test multiple diffs for over a week. With input from nicm, ok miod, derraadt.
Diffstat (limited to 'sys/sys/conf.h')
-rw-r--r--sys/sys/conf.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index a6b5cc2f258..f68f068e843 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.116 2011/09/17 08:36:06 miod Exp $ */
+/* $OpenBSD: conf.h,v 1.117 2011/10/06 09:14:35 mikeb Exp $ */
/* $NetBSD: conf.h,v 1.33 1996/05/03 20:03:32 christos Exp $ */
/*-
@@ -238,7 +238,7 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), (dev_type_close((*))) nullop, dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) nullop, \
0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \
- D_TTY, 0, ttkqfilter }
+ D_TTY, 0, dev_init(c,n,kqfilter) }
/* open, close, read, write, ioctl, mmap */
#define cdev_mm_init(c,n) { \