diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-05-17 00:17:02 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-05-17 00:17:02 +0000 |
commit | 823d3c93ebd241152f5f8c31baf23460447c1372 (patch) | |
tree | cc83e59f6bfebb2f912d772b4c314f4efe422342 /sys | |
parent | dcc913d477adbd50b32597bc319e7c05859d209c (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.c | 7 |
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++; |