diff options
author | Peter Zijlstra <peterz@infradead.org> | 2022-09-29 12:20:50 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-09-29 12:20:50 +0200 |
commit | a1ebcd59430236b336428bbf8e1da16fb87d56e4 (patch) | |
tree | 126b999f1eae9b7ecf1045eec425a6dbcdcb4351 /fs/namespace.c | |
parent | cce6a2d7e0e494c453ad73e1e78bd50684f20cca (diff) | |
parent | f76349cf41451c5c42a99f18a9163377e4b364ff (diff) | |
download | linux-stable-a1ebcd59430236b336428bbf8e1da16fb87d56e4.tar.gz linux-stable-a1ebcd59430236b336428bbf8e1da16fb87d56e4.tar.bz2 linux-stable-a1ebcd59430236b336428bbf8e1da16fb87d56e4.zip |
Merge branch 'v6.0-rc7'
Merge upstream to get RAPTORLAKE_S
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r-- | fs/namespace.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 68789f896f08..df137ba19d37 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -4238,6 +4238,13 @@ static int build_mount_idmapped(const struct mount_attr *attr, size_t usize, err = -EPERM; goto out_fput; } + + /* We're not controlling the target namespace. */ + if (!ns_capable(mnt_userns, CAP_SYS_ADMIN)) { + err = -EPERM; + goto out_fput; + } + kattr->mnt_userns = get_user_ns(mnt_userns); out_fput: |