Skip to content

Commit 08937af

Browse files
author
Ian Kent
committed
do_change_type(): refuse to operate on unmounted/not ours mounts
JIRA: https://issues.redhat.com/browse/RHEL-107307 Upstream status: Linus CVE: CVE-2025-38498 commit 12f147d Author: Al Viro <viro@zeniv.linux.org.uk> Date: Wed Jun 4 12:27:08 2025 -0400 do_change_type(): refuse to operate on unmounted/not ours mounts Ensure that propagation settings can only be changed for mounts located in the caller's mount namespace. This change aligns permission checking with the rest of mount(2). Reviewed-by: Christian Brauner <brauner@kernel.org> Fixes: 07b2088 ("beginning of the shared-subtree proper") Reported-by: "Orlando, Noah" <Noah.Orlando@deshaw.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Ian Kent <ikent@redhat.com>
1 parent 09e34b3 commit 08937af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/namespace.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,6 +2709,10 @@ static int do_change_type(struct path *path, int ms_flags)
27092709
return -EINVAL;
27102710

27112711
namespace_lock();
2712+
if (!check_mnt(mnt)) {
2713+
err = -EINVAL;
2714+
goto out_unlock;
2715+
}
27122716
if (type == MS_SHARED) {
27132717
err = invent_group_ids(mnt, recurse);
27142718
if (err)

0 commit comments

Comments
 (0)