svn commit: r254489 - head/sys/kern
Jilles Tjoelker
jilles at FreeBSD.org
Sun Aug 18 13:27:05 UTC 2013
Author: jilles
Date: Sun Aug 18 13:27:04 2013
New Revision: 254489
URL: http://svnweb.freebsd.org/changeset/base/254489
Log:
Disallow opening a POSIX message queue for execute.
O_EXEC was formerly ignored, so equivalent to O_RDONLY.
Reject O_EXEC with [EINVAL] like the invalid mode 3.
Modified:
head/sys/kern/uipc_mqueue.c
Modified: head/sys/kern/uipc_mqueue.c
==============================================================================
--- head/sys/kern/uipc_mqueue.c Sun Aug 18 13:25:18 2013 (r254488)
+++ head/sys/kern/uipc_mqueue.c Sun Aug 18 13:27:04 2013 (r254489)
@@ -2046,7 +2046,7 @@ sys_kmq_open(struct thread *td, struct k
struct mq_attr attr;
int flags, error;
- if ((uap->flags & O_ACCMODE) == O_ACCMODE)
+ if ((uap->flags & O_ACCMODE) == O_ACCMODE || uap->flags & O_EXEC)
return (EINVAL);
flags = FFLAGS(uap->flags);
if ((flags & O_CREAT) != 0 && uap->attr != NULL) {
@@ -2682,7 +2682,7 @@ freebsd32_kmq_open(struct thread *td, st
struct mq_attr32 attr32;
int flags, error;
- if ((uap->flags & O_ACCMODE) == O_ACCMODE)
+ if ((uap->flags & O_ACCMODE) == O_ACCMODE || uap->flags & O_EXEC)
return (EINVAL);
flags = FFLAGS(uap->flags);
if ((flags & O_CREAT) != 0 && uap->attr != NULL) {
More information about the svn-src-all
mailing list