[Devel] [PATCH rh7] ve/fuse: allow to mount fuse in non-init user_ns

Konstantin Khorenko khorenko at virtuozzo.com
Wed Jun 20 13:09:18 MSK 2018


RHEL7.5 enforced sget() (sget_userns() in fact) to check the
FS_USERNS_MOUNT flag on fs_flags, fuse lacks the flag and
thus we are unable to mount fuse inside a Container.

Fix this - allow fuse to be mounted in non-init user namespaces.

Fixes: 371904f01f05 ("fuse: virtualize file system")
https://jira.sw.ru/browse/PSBM-85886

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/fuse/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 8a9fa0d7997d..07b526818939 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1445,7 +1445,7 @@ static void fuse_kill_sb_anon(struct super_block *sb)
 static struct file_system_type fuse_fs_type = {
 	.owner		= THIS_MODULE,
 	.name		= "fuse",
-	.fs_flags	= FS_HAS_SUBTYPE | FS_VIRTUALIZED,
+	.fs_flags	= FS_HAS_SUBTYPE | FS_VIRTUALIZED | FS_USERNS_MOUNT,
 	.mount		= fuse_mount,
 	.kill_sb	= fuse_kill_sb_anon,
 };
-- 
2.15.1



More information about the Devel mailing list