-/* $OpenBSD: kern_pledge.c,v 1.207 2017/04/29 08:02:56 mpi Exp $ */
+/* $OpenBSD: kern_pledge.c,v 1.208 2017/05/02 16:46:00 natano Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
switch (com) {
case BIOCGSTATS: /* bpf: tcpdump privsep on ^C */
if (fp->f_type == DTYPE_VNODE &&
- fp->f_ops->fo_ioctl == vn_ioctl)
+ fp->f_ops->fo_ioctl == vn_ioctl &&
+ vp->v_type == VCHR &&
+ cdevsw[major(vp->v_rdev)].d_open == bpfopen)
return (0);
break;
}