]> git.baikalelectronics.ru Git - kernel.git/commit
mount: Retest MNT_LOCKED in do_umount
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 22 Oct 2018 15:21:38 +0000 (10:21 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 8 Nov 2018 06:14:21 +0000 (00:14 -0600)
commit41ec1532b04982592096a163cd7845a2a6c9ca71
treeb4cfb10402b67f208c0dfe070150d7a066d58f04
parent56dab533e5201a89a283ff58b297b9d97ae858f2
mount: Retest MNT_LOCKED in do_umount

It was recently pointed out that the one instance of testing MNT_LOCKED
outside of the namespace_sem is in ksys_umount.

Fix that by adding a test inside of do_umount with namespace_sem and
the mount_lock held.  As it helps to fail fails the existing test is
maintained with an additional comment pointing out that it may be racy
because the locks are not held.

Cc: stable@vger.kernel.org
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Fixes: b4fb41a1029d ("vfs: Lock in place mounts from more privileged users")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/namespace.c