You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use uniform permission checks for all mount propagation changes
JIRA: https://issues.redhat.com/browse/RHEL-107307
Upstream status: Linus
CVE: CVE-2025-38498
Conflicts: There is a fuzz 1 for hunk #1 in fs/namespace.c. This is due
to the lack of upstream commit 86b1da9 ("attach_recursive_mnt():
get rid of flags entirely") which depends on a number of other patches
that add function getname_maybe_null() among other changes. But what
these two patches do to resolve the CVE is well defined and without
further dependencies. In particular this patch is an additional patch
to the original patch to resolve the CVE and is needed to prevent
regressions that would very likely be seen in our products in the same
way as were seen and reported upstream.
commit cffd044
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Thu Aug 14 01:44:31 2025 -0400
use uniform permission checks for all mount propagation changes
do_change_type() and do_set_group() are operating on different
aspects of the same thing - propagation graph. The latter
asks for mounts involved to be mounted in namespace(s) the caller
has CAP_SYS_ADMIN for. The former is a mess - originally it
didn't even check that mount *is* mounted. That got fixed,
but the resulting check turns out to be too strict for userland -
in effect, we check that mount is in our namespace, having already
checked that we have CAP_SYS_ADMIN there.
What we really need (in both cases) is
* only touch mounts that are mounted. That's a must-have
constraint - data corruption happens if it get violated.
* don't allow to mess with a namespace unless you already
have enough permissions to do so (i.e. CAP_SYS_ADMIN in its userns).
That's an equivalent of what do_set_group() does; let's extract that
into a helper (may_change_propagation()) and use it in both
do_set_group() and do_change_type().
Fixes: 12f147d "do_change_type(): refuse to operate on unmounted/not ours mounts"
Acked-by: Andrei Vagin <avagin@gmail.com>
Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Tested-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Ian Kent <ikent@redhat.com>
0 commit comments