mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
synced 2025-09-13 11:07:46 +10:00
do_change_type(): refuse to operate on unmounted/not ours mounts
[ Upstream commit12f147ddd6
] 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:07b20889e3
("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: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
9eba557c5b
commit
c7d11fdf8e
@ -2308,6 +2308,10 @@ static int do_change_type(struct path *path, int ms_flags)
|
||||
return -EINVAL;
|
||||
|
||||
namespace_lock();
|
||||
if (!check_mnt(mnt)) {
|
||||
err = -EINVAL;
|
||||
goto out_unlock;
|
||||
}
|
||||
if (type == MS_SHARED) {
|
||||
err = invent_group_ids(mnt, recurse);
|
||||
if (err)
|
||||
|
Loading…
Reference in New Issue
Block a user