diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2014-07-28 16:26:53 -0700 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2014-07-31 17:11:54 -0700 |
commit | a6138db815df5ee542d848318e5dae681590fccd (patch) | |
tree | 52f996bcb8b01b4d1e4ee3705c0f646e549fa41a /include/linux/mount.h | |
parent | 728dba3a39c66b3d8ac889ddbe38b5b1c264aec3 (diff) |
mnt: Only change user settable mount flags in remount
Kenton Varda <kenton@sandstorm.io> discovered that by remounting a
read-only bind mount read-only in a user namespace the
MNT_LOCK_READONLY bit would be cleared, allowing an unprivileged user
to the remount a read-only mount read-write.
Correct this by replacing the mask of mount flags to preserve
with a mask of mount flags that may be changed, and preserve
all others. This ensures that any future bugs with this mask and
remount will fail in an easy to detect way where new mount flags
simply won't change.
Cc: stable@vger.kernel.org
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'include/linux/mount.h')
-rw-r--r-- | include/linux/mount.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/mount.h b/include/linux/mount.h index 839bac27090..b637a89e1fa 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -42,7 +42,9 @@ struct mnt_namespace; * flag, consider how it interacts with shared mounts. */ #define MNT_SHARED_MASK (MNT_UNBINDABLE) -#define MNT_PROPAGATION_MASK (MNT_SHARED | MNT_UNBINDABLE) +#define MNT_USER_SETTABLE_MASK (MNT_NOSUID | MNT_NODEV | MNT_NOEXEC \ + | MNT_NOATIME | MNT_NODIRATIME | MNT_RELATIME \ + | MNT_READONLY) #define MNT_INTERNAL_FLAGS (MNT_SHARED | MNT_WRITE_HOLD | MNT_INTERNAL | \ MNT_DOOMED | MNT_SYNC_UMOUNT | MNT_MARKED) |