]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs: Allow statmount() in foreign mount namespace
authorChristian Brauner <brauner@kernel.org>
Mon, 24 Jun 2024 15:49:49 +0000 (11:49 -0400)
committerChristian Brauner <brauner@kernel.org>
Fri, 28 Jun 2024 07:53:31 +0000 (09:53 +0200)
commit71aacb4c8c3d19da053363a5fe7538a8af082d56
tree2fe38d4370d8aeead6f7559abf8dd6703e7a423c
parent0a3deb11858ae8a0b3849b5fda45512ad383f0e1
fs: Allow statmount() in foreign mount namespace

This patch makes use of the new mnt_ns_id field in struct mnt_id_req to
allow users to stat mount entries not in their mount namespace.  The
rules are the same as listmount(), the user must have CAP_SYS_ADMIN in
their user namespace and the target mount namespace must be a child of
the current namespace.

Co-developed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/r/52a2e17e50ba7aa420bc8bae1d9e88ff593395c1.1719243756.git.josef@toxicpanda.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c