projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d04bccd
)
fs: relax permissions for listmount()
author
Christian Brauner
<brauner@kernel.org>
Mon, 24 Jun 2024 15:49:44 +0000
(11:49 -0400)
committer
Christian Brauner
<brauner@kernel.org>
Fri, 28 Jun 2024 07:53:29 +0000
(09:53 +0200)
It is sufficient to have capabilities in the owning user namespace of
the mount namespace to list all mounts regardless of whether they are
reachable or not.
Link:
https://lore.kernel.org/r/8adc0d3f4f7495faacc6a7c63095961f7f1637c7.1719243756.git.josef@toxicpanda.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c
patch
|
blob
|
history
diff --git
a/fs/namespace.c
b/fs/namespace.c
index
02a6972
..
22274f7
100644
(file)
--- a/
fs/namespace.c
+++ b/
fs/namespace.c
@@
-5104,7
+5104,7
@@
static ssize_t do_listmount(u64 mnt_parent_id, u64 last_mnt_id, u64 *mnt_ids,
* mounts to show users.
*/
if (!is_path_reachable(real_mount(orig.mnt), orig.dentry, &root) &&
- !ns_capable_noaudit(
&init_
user_ns, CAP_SYS_ADMIN))
+ !ns_capable_noaudit(
ns->
user_ns, CAP_SYS_ADMIN))
return -EPERM;
ret = security_sb_statfs(orig.dentry);