diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-03-17 23:02:24 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-03-25 13:10:33 +0300 |
| commit | 2f3dea284c761c890d676f77d5e55c0c496b4ef4 (patch) | |
| tree | 12ce2a90026852c077c308eb02dca850df2f97f6 /include | |
| parent | 05edc78eb4699e8e000a62aaa8dace50a17e19e3 (diff) | |
| download | linux-2f3dea284c761c890d676f77d5e55c0c496b4ef4.tar.xz | |
nsfs: tighten permission checks for ns iteration ioctls
[ Upstream commit e6b899f08066e744f89df16ceb782e06868bd148 ]
Even privileged services should not necessarily be able to see other
privileged service's namespaces so they can't leak information to each
other. Use may_see_all_namespaces() helper that centralizes this policy
until the nstree adapts.
Link: https://patch.msgid.link/20260226-work-visibility-fixes-v1-1-d2c2853313bd@kernel.org
Fixes: a1d220d9dafa ("nsfs: iterate through mount namespaces")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Cc: stable@kernel.org # v6.12+
Signed-off-by: Christian Brauner <brauner@kernel.org>
[ context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/ns_common.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/ns_common.h b/include/linux/ns_common.h index 71a5e28344d1..f3c52904343e 100644 --- a/include/linux/ns_common.h +++ b/include/linux/ns_common.h @@ -144,6 +144,8 @@ void __ns_common_free(struct ns_common *ns); #define ns_common_free(__ns) __ns_common_free(to_ns_common((__ns))) +bool may_see_all_namespaces(void); + static __always_inline __must_check bool __ns_ref_put(struct ns_common *ns) { return refcount_dec_and_test(&ns->__ns_ref); |
