mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
do_change_type(): refuse to operate on unmounted/not ours mounts
[ Upstream commit 12f147ddd6de7382dad54812e65f3f08d05809fc ]
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: 07b20889e3 ("beginning of the shared-subtree proper")
Reported-by: "Orlando, Noah" <[email protected]>
Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
36d91620a6
commit
787937c4e3
1 changed files with 4 additions and 0 deletions
|
|
@ -2246,6 +2246,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 a new issue