Commit fd912087 authored by Al Viro's avatar Al Viro

legacy_get_tree(): pass fc->user_ns to mount_capable()

guaranteed to be equal to current_user_ns() here - it has not
been changed since alloc_fs_context() (nothing in legacy
methods changes it) and since we don't have SB_SUBMOUNT,
that must've been FS_CONTEXT_FOR_MOUNT.  And in that case
we have fc->user_ns set to fc->cred->user_ns, i.e.
current_cred()->user_ns, i.e. current_user_ns()
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 2527b284
......@@ -663,7 +663,7 @@ static int legacy_get_tree(struct fs_context *fc)
struct dentry *root;
if (!(fc->sb_flags & (SB_KERNMOUNT|SB_SUBMOUNT))) {
if (!mount_capable(fc->fs_type, current_user_ns()))
if (!mount_capable(fc->fs_type, fc->user_ns))
return -EPERM;
}
......
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