Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Aug 2013 13:27:04 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254489 - head/sys/kern
Message-ID:  <201308181327.r7IDR4Xg051791@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308181327.r7IDR4Xg051791>