diff options
authorEric W. Biederman <ebiederm@xmission.com>2016-05-27 14:50:05 -0500
committerSasha Levin <sasha.levin@oracle.com>2016-06-19 23:47:44 -0400
commit68924d2d32edadfbf9c2819ff3635248a192a90a (patch)
parent7fca87231b6a08e5fe86b02b191527a673f50e71 (diff)
mnt: fs_fully_visible test the proper mount for MNT_LOCKED
[ Upstream commit d71ed6c930ac7d8f88f3cef6624a7e826392d61f ] MNT_LOCKED implies on a child mount implies the child is locked to the parent. So while looping through the children the children should be tested (not their parent). Typically an unshare of a mount namespace locks all mounts together making both the parent and the slave as locked but there are a few corner cases where other things work. Cc: stable@vger.kernel.org Fixes: ceeb0e5d39fc ("vfs: Ignore unlocked mounts in fs_fully_visible") Reported-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index b0b78827ec55..db31a49e01fd 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3175,7 +3175,7 @@ static bool fs_fully_visible(struct file_system_type *type, int *new_mnt_flags)
list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) {
struct inode *inode = child->mnt_mountpoint->d_inode;
/* Only worry about locked mounts */
- if (!(mnt->mnt.mnt_flags & MNT_LOCKED))
+ if (!(child->mnt.mnt_flags & MNT_LOCKED))
if (!S_ISDIR(inode->i_mode))
goto next;