summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2011-05-17 00:17:02 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2011-05-17 00:17:02 +0000
commit823d3c93ebd241152f5f8c31baf23460447c1372 (patch)
treecc83e59f6bfebb2f912d772b4c314f4efe422342 /sys
parentdcc913d477adbd50b32597bc319e7c05859d209c (diff)
Ban passing of kqueue descriptors via UNIX domain sockets. Currently,
they're tightly bound to struct filedesc, leading to NULL derefs during exit1(). ok henning@, millert@, kettenis@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_usrreq.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 4d47ed60567..e7bd6e4e331 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_usrreq.c,v 1.50 2011/04/04 12:44:10 deraadt Exp $ */
+/* $OpenBSD: uipc_usrreq.c,v 1.51 2011/05/17 00:17:01 guenther Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */
/*
@@ -777,6 +777,11 @@ morespace:
error = EDEADLK;
goto fail;
}
+ /* kq descriptors cannot be copied */
+ if (fp->f_type == DTYPE_KQUEUE) {
+ error = EINVAL;
+ goto fail;
+ }
bcopy(&fp, rp, sizeof fp);
rp--;
fp->f_count++;