Skip to content

Commit cce40d8

Browse files
committed
do_change_type(): refuse to operate on unmounted/not ours mounts
jira LE-4321 cve CVE-2025-38498 Rebuild_History Non-Buildable kernel-4.18.0-553.76.1.el8_10 commit-author Al Viro <viro@zeniv.linux.org.uk> 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 <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> (cherry picked from commit 12f147d) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent ac8fa4e commit cce40d8

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

22922292
namespace_lock();
2293+
if (!check_mnt(mnt)) {
2294+
err = -EINVAL;
2295+
goto out_unlock;
2296+
}
22932297
if (type == MS_SHARED) {
22942298
err = invent_group_ids(mnt, recurse);
22952299
if (err)

0 commit comments

Comments
 (0)