Commit a2da8ccb authored by Seth Forshee's avatar Seth Forshee Committed by Tim Gardner

UBUNTU: SAUCE: fuse: Add module parameter to enable user namespace mounts

This is still an experimental feature, so disable it by default
and allow it only when the system administrator supplies the
userns_mounts=true module parameter.
Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 41d8f9b2
......@@ -48,6 +48,10 @@ MODULE_PARM_DESC(max_user_congthresh,
"Global limit for the maximum congestion threshold an "
"unprivileged user can set");
static bool userns_mounts;
module_param(userns_mounts, bool, 0644);
MODULE_PARM_DESC(userns_mounts, "Allow mounts from unprivileged user namespaces");
#define FUSE_SUPER_MAGIC 0x65735546
#define FUSE_DEFAULT_BLKSIZE 512
......@@ -1047,6 +1051,9 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
int err;
int is_bdev = sb->s_bdev != NULL;
if (!userns_mounts && !capable(CAP_SYS_ADMIN))
return -EPERM;
err = -EINVAL;
if (sb->s_flags & MS_MANDLOCK)
goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment