diff options
author | kib <kib@FreeBSD.org> | 2013-12-17 17:28:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-12-17 17:28:02 +0000 |
commit | 6ef68a42084eb753005a5251593d103fd5ee98a1 (patch) | |
tree | 21b1b3cc370bb2aa378c75d9dd1d4e716d31056f /sys/fs | |
parent | 89e2f991302da7e1bb3fc0596f51c1d9e7f122ad (diff) | |
download | FreeBSD-src-6ef68a42084eb753005a5251593d103fd5ee98a1.zip FreeBSD-src-6ef68a42084eb753005a5251593d103fd5ee98a1.tar.gz |
Do not allow O_EXEC opens for fifo, return EINVAL.
Besides not making sense, open(O_EXEC) for fifo creates fifoinfo with
zero readers and writers counts, which causes premature free of pipes.
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/fifofs/fifo_vnops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index bdb1367..d3eb281 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -143,7 +143,7 @@ fifo_open(ap) fp = ap->a_fp; td = ap->a_td; ASSERT_VOP_ELOCKED(vp, "fifo_open"); - if (fp == NULL) + if (fp == NULL || (ap->a_mode & FEXEC) != 0) return (EINVAL); if ((fip = vp->v_fifoinfo) == NULL) { error = pipe_named_ctor(&fpipe, td); |