]> git.ipfire.org Git - people/ms/linux.git/commit
mnt: Only change user settable mount flags in remount
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 28 Jul 2014 23:26:53 +0000 (16:26 -0700)
committerJiri Slaby <jslaby@suse.cz>
Tue, 26 Aug 2014 12:12:04 +0000 (14:12 +0200)
commit25c1def33a2f74079f3062b7afdf98fcf9f34e6d
tree053deda966e9eb6a9fe8b4b0653ac68c87230ea4
parent542b50ef6910233f971d30aae0e1322339e25ae9
mnt: Only change user settable mount flags in remount

commit a6138db815df5ee542d848318e5dae681590fccd upstream.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/namespace.c
include/linux/mount.h