[Devel] [PATCH rh7 v2 2/2] fuse: allow to mount fuse filesystems inside CT

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Nov 11 08:09:39 PST 2015


Currently mounting fuse fs inside CT fails because
we don't pass (file->f_cred->user_ns != &init_user_ns) check.
Test file's namespace against VE's init_cred->user_ns instead.
This allows to use fuse inside containers.

https://jira.sw.ru/browse/PSBM-41075

Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 fs/fuse/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 4a1b46f..bb010cb 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -20,6 +20,7 @@
 #include <linux/random.h>
 #include <linux/sched.h>
 #include <linux/exportfs.h>
+#include <linux/ve.h>
 
 MODULE_AUTHOR("Miklos Szeredi <miklos at szeredi.hu>");
 MODULE_DESCRIPTION("Filesystem in Userspace");
@@ -1147,7 +1148,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
 		goto err;
 
 	if ((file->f_op != &fuse_dev_operations) ||
-	    (file->f_cred->user_ns != &init_user_ns))
+	    (file->f_cred->user_ns != ve_init_user_ns()))
 		goto err_fput;
 
 	fc = kmalloc(sizeof(*fc), GFP_KERNEL);
-- 
2.4.10



More information about the Devel mailing list