mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 06:14:27 +00:00
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
This commit is contained in:
parent
da0770bd57
commit
f26ca5ecde
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=259521
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue