From f5caa5a507338e1e97d435df73c78a80915fc7a1 Mon Sep 17 00:00:00 2001 From: dchagin Date: Tue, 7 Mar 2017 17:09:12 +0000 Subject: [PATCH] Linux kernel does not export to the user space ipc_perm.mode values other than S_IRWXUGO (0777). MFC after: 1 month --- sys/compat/linux/linux_ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index c85dfb09f88d..a8c55099ed8b 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "opt_compat.h" @@ -151,7 +152,7 @@ bsd_to_linux_ipc_perm(struct ipc_perm *bpp, struct l_ipc64_perm *lpp) 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; }