]> git.baikalelectronics.ru Git - kernel.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)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 1 Aug 2014 00:11:54 +0000 (17:11 -0700)
commiteec38d12cdf1b6266eb88de9c25333c9c3c1db12
tree52f996bcb8b01b4d1e4ee3705c0f646e549fa41a
parent37fd8779e1503e8bdfff25d1d6916d3bdfb6294a
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>
fs/namespace.c
include/linux/mount.h