Skip to content

Commit 808d2aa

Browse files
committed
do_change_type(): refuse to operate on unmounted/not ours mounts
jira LE-4311 cve CVE-2025-38498 Rebuild_History Non-Buildable kernel-5.14.0-570.46.1.el9_6 commit-author Al Viro <[email protected]> commit 12f147d 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 <[email protected]> Fixes: 07b2088 ("beginning of the shared-subtree proper") Reported-by: "Orlando, Noah" <[email protected]> Signed-off-by: Al Viro <[email protected]> (cherry picked from commit 12f147d) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 01713e7 commit 808d2aa

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
@@ -2317,6 +2317,10 @@ static int do_change_type(struct path *path, int ms_flags)
23172317
return -EINVAL;
23182318

23192319
namespace_lock();
2320+
if (!check_mnt(mnt)) {
2321+
err = -EINVAL;
2322+
goto out_unlock;
2323+
}
23202324
if (type == MS_SHARED) {
23212325
err = invent_group_ids(mnt, recurse);
23222326
if (err)

0 commit comments

Comments
 (0)