summaryrefslogtreecommitdiff
path: root/fs/fuse/inode.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-05-04 11:47:28 -0500
committerMiklos Szeredi <mszeredi@redhat.com>2018-05-31 12:26:10 +0200
commite45b2546e23c2d10f8585063a15c745a7603fac9 (patch)
tree6203c459f681766f6e073d3a3ffbf9766e77ec91 /fs/fuse/inode.c
parent5ba24197b94d4070d8c2a17fa4944a55cc39ef03 (diff)
fuse: Ensure posix acls are translated outside of init_user_ns
Ensure the translation happens by failing to read or write posix acls when the filesystem has not indicated it supports posix acls. This ensures that modern cached posix acl support is available and used when dealing with posix acls. This is important because only that path has the code to convernt the uids and gids in posix acls into the user namespace of a fuse filesystem. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r--fs/fuse/inode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 1643043d4fe5..22c76cf8c2e3 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1100,6 +1100,13 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
file->f_cred->user_ns != sb->s_user_ns)
goto err_fput;
+ /*
+ * If we are not in the initial user namespace posix
+ * acls must be translated.
+ */
+ if (sb->s_user_ns != &init_user_ns)
+ sb->s_xattr = fuse_no_acl_xattr_handlers;
+
fc = kmalloc(sizeof(*fc), GFP_KERNEL);
err = -ENOMEM;
if (!fc)