diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-05-12 17:23:30 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-05-25 17:59:58 -0400 |
commit | fd912087f4a897cfdf8274f8085c501742638be2 (patch) | |
tree | f9c4204ac11ce422bfc33475b202544e0b0fcc9f | |
parent | 2527b284defaeadf74829b0b0bd3207ca7f165eb (diff) | |
download | lwn-fd912087f4a897cfdf8274f8085c501742638be2.tar.gz lwn-fd912087f4a897cfdf8274f8085c501742638be2.zip |
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: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/fs_context.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fs_context.c b/fs/fs_context.c index 746a5871959c..d75ba0eb8c5b 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -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; } |