[RHEL7,COMMIT] ve/fuse: allow to mount fuse in non-init user_ns

Submitted by Konstantin Khorenko on June 25, 2018, 4:19 p.m.

Details

Message ID 201806251619.w5PGJBgt012060@finist_ce7.work
State New
Series "ve/fuse: allow to mount fuse in non-init user_ns"
Headers show

Commit Message

Konstantin Khorenko June 25, 2018, 4:19 p.m.
The commit is pushed to "branch-rh7-3.10.0-862.3.2.vz7.61.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.3.2.vz7.61.4
------>
commit ec7f34c5e96b5a5ff07d34a9a2fb102d6969bdde
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Wed Jun 20 12:43:53 2018 +0300

    ve/fuse: allow to mount fuse in non-init user_ns
    
    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@virtuozzo.com>
---
 fs/fuse/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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,
 };