diff options
author | alfred <alfred@FreeBSD.org> | 2003-02-15 06:04:55 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2003-02-15 06:04:55 +0000 |
commit | 29fb7c2bce463e61580d0653a141df43ac982c4f (patch) | |
tree | 6c098d97cace4a0b11af4f27480aefdb513d245a /sys/kern | |
parent | 4d9a4192f7eb015a646c0400dfb5aa7099a3a402 (diff) | |
download | FreeBSD-src-29fb7c2bce463e61580d0653a141df43ac982c4f.zip FreeBSD-src-29fb7c2bce463e61580d0653a141df43ac982c4f.tar.gz |
Do not allow kqueues to be passed via unix domain sockets.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_descrip.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_event.c | 3 | ||||
-rw-r--r-- | sys/kern/sys_pipe.c | 2 | ||||
-rw-r--r-- | sys/kern/sys_socket.c | 2 | ||||
-rw-r--r-- | sys/kern/uipc_usrreq.c | 7 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 2 |
6 files changed, 14 insertions, 5 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 5e2ac9b..ba3424d 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2181,7 +2181,8 @@ struct fileops badfileops = { badfo_poll, badfo_kqfilter, badfo_stat, - badfo_close + badfo_close, + 0 }; static int diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 04d5a77..4910b7e 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -74,7 +74,8 @@ static struct fileops kqueueops = { kqueue_poll, kqueue_kqfilter, kqueue_stat, - kqueue_close + kqueue_close, + 0 }; static void knote_attach(struct knote *kn, struct filedesc *fdp); diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 7fbceb5..2612101 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -104,7 +104,7 @@ static fo_close_t pipe_close; static struct fileops pipeops = { pipe_read, pipe_write, pipe_ioctl, pipe_poll, pipe_kqfilter, - pipe_stat, pipe_close + pipe_stat, pipe_close, DFLAG_PASSABLE }; static void filt_pipedetach(struct knote *kn); diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 9936cd2..bf80a7b 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -57,7 +57,7 @@ struct fileops socketops = { soo_read, soo_write, soo_ioctl, soo_poll, soo_kqfilter, - soo_stat, soo_close + soo_stat, soo_close, DFLAG_PASSABLE }; /* ARGSUSED */ diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 102d156..51c7d84 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1171,6 +1171,13 @@ unp_internalize(controlp, td) error = EBADF; goto out; } + fp = fdescp->fd_ofiles[fd]; + if (!(fp->f_ops->fo_flags & DFLAG_PASSABLE)) { + FILEDESC_UNLOCK(fdescp); + error = EOPNOTSUPP; + goto out; + } + } /* * Now replace the integer FDs with pointers to diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 7891dc6..eba9f5d 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -73,7 +73,7 @@ static fo_close_t vn_closefile; struct fileops vnops = { vn_read, vn_write, vn_ioctl, vn_poll, vn_kqfilter, - vn_statfile, vn_closefile + vn_statfile, vn_closefile, DFLAG_PASSABLE }; int |