From: Al Viro Date: Sat, 16 Jan 2010 17:56:08 +0000 (-0500) Subject: may_umount() needs namespace_sem X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8ad08d8a0c3823e9b06ef84c362c9361be323d2d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git may_umount() needs namespace_sem otherwise it races with clone_mnt() changing mnt_share/mnt_slaves Signed-off-by: Al Viro --- diff --git a/fs/namespace.c b/fs/namespace.c index 7d70d63ceb29..461090a57b33 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -965,10 +965,12 @@ EXPORT_SYMBOL(may_umount_tree); int may_umount(struct vfsmount *mnt) { int ret = 1; + down_read(&namespace_sem); spin_lock(&vfsmount_lock); if (propagate_mount_busy(mnt, 2)) ret = 0; spin_unlock(&vfsmount_lock); + up_read(&namespace_sem); return ret; }