]> git.baikalelectronics.ru Git - kernel.git/commit
mnt: Account for MS_RDONLY in fs_fully_visible
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 10 Jun 2016 17:21:40 +0000 (12:21 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 15 Jun 2016 11:52:23 +0000 (06:52 -0500)
commitf83ee3d03f36399debd8d5de76edf10efc39bb72
tree9f945a72c428a3fdfb66d999fed31d0b7374f12c
parent471e1eb043589aaeb144e9f6858d22c20750ca48
mnt: Account for MS_RDONLY in fs_fully_visible

In rare cases it is possible for s_flags & MS_RDONLY to be set but
MNT_READONLY to be clear.  This starting combination can cause
fs_fully_visible to fail to ensure that the new mount is readonly.
Therefore force MNT_LOCK_READONLY in the new mount if MS_RDONLY
is set on the source filesystem of the mount.

In general both MS_RDONLY and MNT_READONLY are set at the same for
mounts so I don't expect any programs to care.  Nor do I expect
MS_RDONLY to be set on proc or sysfs in the initial user namespace,
which further decreases the likelyhood of problems.

Which means this change should only affect system configurations by
paranoid sysadmins who should welcome the additional protection
as it keeps people from wriggling out of their policies.

Cc: stable@vger.kernel.org
Fixes: a5b9e4924f6d ("mnt: Modify fs_fully_visible to deal with locked ro nodev and atime")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/namespace.c