Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Mar 2017 17:09:12 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r314867 - head/sys/compat/linux
Message-ID:  <201703071709.v27H9Cng058351@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Tue Mar  7 17:09:12 2017
New Revision: 314867
URL: https://svnweb.freebsd.org/changeset/base/314867

Log:
  Linux kernel does not export to the user space ipc_perm.mode values
  other than S_IRWXUGO (0777).
  
  MFC after:	1 month

Modified:
  head/sys/compat/linux/linux_ipc.c

Modified: head/sys/compat/linux/linux_ipc.c
==============================================================================
--- head/sys/compat/linux/linux_ipc.c	Tue Mar  7 17:07:16 2017	(r314866)
+++ head/sys/compat/linux/linux_ipc.c	Tue Mar  7 17:09:12 2017	(r314867)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/msg.h>
 #include <sys/sem.h>
 #include <sys/shm.h>
+#include <sys/stat.h>
 
 #include "opt_compat.h"
 
@@ -151,7 +152,7 @@ bsd_to_linux_ipc_perm(struct ipc_perm *b
 	lpp->gid = bpp->gid;
 	lpp->cuid = bpp->cuid;
 	lpp->cgid = bpp->cgid;
-	lpp->mode = bpp->mode;
+	lpp->mode = bpp->mode & (S_IRWXU|S_IRWXG|S_IRWXO);
 	lpp->seq = bpp->seq;
 }
 



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