diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2016-05-27 15:50:05 -0400 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2016-06-06 21:52:03 -0400 |
commit | d71ed6c930ac7d8f88f3cef6624a7e826392d61f (patch) | |
tree | 322444a9a4901a7c43dfea1fb5cd056306288eeb | |
parent | 97c1df3e54e811aed484a036a798b4b25d002ecf (diff) |
mnt: fs_fully_visible test the proper mount for MNT_LOCKED
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>
-rw-r--r-- | fs/namespace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 9d45c8a3414f..a7ec92c051f5 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -3273,7 +3273,7 @@ static bool fs_fully_visible(struct file_system_type *type, int *new_mnt_flags) | |||
3273 | list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) { | 3273 | list_for_each_entry(child, &mnt->mnt_mounts, mnt_child) { |
3274 | struct inode *inode = child->mnt_mountpoint->d_inode; | 3274 | struct inode *inode = child->mnt_mountpoint->d_inode; |
3275 | /* Only worry about locked mounts */ | 3275 | /* Only worry about locked mounts */ |
3276 | if (!(mnt_flags & MNT_LOCKED)) | 3276 | if (!(child->mnt.mnt_flags & MNT_LOCKED)) |
3277 | continue; | 3277 | continue; |
3278 | /* Is the directory permanetly empty? */ | 3278 | /* Is the directory permanetly empty? */ |
3279 | if (!is_empty_dir_inode(inode)) | 3279 | if (!is_empty_dir_inode(inode)) |