Currently, the only intended direct usage of the EVFILT_EXCEPT filter
is with NOTE_OOB to detect out-of-band data in ptys and sockets.
NOTE_OOB does not apply to FIFOs or pipes. Prevent the user from
registering the filter with these file types. The filter code is for
the kernel's internal use.
OK mpi@
-/* $OpenBSD: sys_pipe.c,v 1.131 2021/12/08 13:03:52 visa Exp $ */
+/* $OpenBSD: sys_pipe.c,v 1.132 2021/12/13 14:54:22 visa Exp $ */
/*
* Copyright (c) 1996 John S. Dyson
error = EPERM;
break;
}
+ if ((kn->kn_flags & __EV_POLL) == 0) {
+ /* Disallow usage through kevent(2). */
+ error = EINVAL;
+ break;
+ }
kn->kn_fop = &pipe_efiltops;
kn->kn_hook = rpipe;
klist_insert_locked(&rpipe->pipe_sel.si_note, kn);
-/* $OpenBSD: fifo_vnops.c,v 1.87 2021/12/11 09:28:26 visa Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.88 2021/12/13 14:54:22 visa Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
/* Prevent triggering exceptfds. */
return (EPERM);
}
+ if ((ap->a_kn->kn_flags & __EV_POLL) == 0) {
+ /* Disallow usage through kevent(2). */
+ return (EINVAL);
+ }
ap->a_kn->kn_fop = &fifoexcept_filtops;
so = fip->fi_readsock;
sb = &so->so_rcv;