mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
mnt: Implicitly add MNT_NODEV on remount when it was implicitly added by mount
Now that remount is properly enforcing the rule that you can't remove nodev at least sandstorm.io is breaking when performing a remount. It turns out that there is an easy intuitive solution implicitly add nodev on remount when nodev was implicitly added on mount. Tested-by: Cedric Bosdonnat <[email protected]> Tested-by: Richard Weinberger <[email protected]> Cc: [email protected] Signed-off-by: "Eric W. Biederman" <[email protected]>
This commit is contained in:
parent
5d01410fe4
commit
3e1866410f
1 changed files with 7 additions and 1 deletions
|
|
@ -2098,7 +2098,13 @@ static int do_remount(struct path *path, int flags, int mnt_flags,
|
|||
}
|
||||
if ((mnt->mnt.mnt_flags & MNT_LOCK_NODEV) &&
|
||||
!(mnt_flags & MNT_NODEV)) {
|
||||
return -EPERM;
|
||||
/* Was the nodev implicitly added in mount? */
|
||||
if ((mnt->mnt_ns->user_ns != &init_user_ns) &&
|
||||
!(sb->s_type->fs_flags & FS_USERNS_DEV_MOUNT)) {
|
||||
mnt_flags |= MNT_NODEV;
|
||||
} else {
|
||||
return -EPERM;
|
||||
}
|
||||
}
|
||||
if ((mnt->mnt.mnt_flags & MNT_LOCK_NOSUID) &&
|
||||
!(mnt_flags & MNT_NOSUID)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue