summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-07-20 02:43:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-07-20 02:43:27 +0000
commitda0adbd2f48dd795a5d06f1df5ff34da78403c75 (patch)
tree2a33b5583a45becf92f93ac4c28ef2b8db8c7c6e /sys/kern
parent6914479d7ab38fa32c2dcce5aa7b68983bd7db2a (diff)
In TAME_IOCTL, permit BIOCGSTATS on a vnode. We don't drill down deeper
yet to verify it is a bpf node. Will be used by tcpdump privsep side.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_tame.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_tame.c b/sys/kern/kern_tame.c
index d01f7c52c4a..bc990a5aa99 100644
--- a/sys/kern/kern_tame.c
+++ b/sys/kern/kern_tame.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_tame.c,v 1.2 2015/07/19 21:25:32 deraadt Exp $ */
+/* $OpenBSD: kern_tame.c,v 1.3 2015/07/20 02:43:26 deraadt Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@ -706,6 +706,12 @@ tame_ioctl_check(struct proc *p, long com, void *v)
*/
switch (com) {
+ case BIOCGSTATS: /* bpf: tcpdump privsep on ^C */
+ if (fp->f_type == DTYPE_VNODE &&
+ fp->f_ops->fo_ioctl == vn_ioctl)
+ return (0);
+ break;
+
case TIOCSETAF: /* tcsetattr TCSAFLUSH, script */
if (fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY))
return (0);