diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2014-01-20 18:26:15 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-06 14:08:16 -0500 |
commit | 9a8bd082503f4f91176d8fe0b91a23c5b768008e (patch) | |
tree | bd14ed7a2f8f211b8b89ddb8533fe5bfd4ba2010 | |
parent | 209bd086e423d98ddf2fd52a6f1afda15b5758b1 (diff) |
vfs: Is mounted should be testing mnt_ns for NULL or error.
commit 260a459d2e39761fbd39803497205ce1690bc7b1 upstream.
A bug was introduced with the is_mounted helper function in
commit f7a99c5b7c8bd3d3f533c8b38274e33f3da9096e
Author: Al Viro <viro@zeniv.linux.org.uk>
Date: Sat Jun 9 00:59:08 2012 -0400
get rid of ->mnt_longterm
it's enough to set ->mnt_ns of internal vfsmounts to something
distinct from all struct mnt_namespace out there; then we can
just use the check for ->mnt_ns != NULL in the fast path of
mntput_no_expire()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
The intent was to test if the real_mount(vfsmount)->mnt_ns was
NULL_OR_ERR but the code is actually testing real_mount(vfsmount)
and always returning true.
The result is d_absolute_path returning paths it should be hiding.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/mount.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/mount.h b/fs/mount.h index 64a858143ff9..68d80bdcd081 100644 --- a/fs/mount.h +++ b/fs/mount.h | |||
@@ -73,7 +73,7 @@ static inline int mnt_has_parent(struct mount *mnt) | |||
73 | static inline int is_mounted(struct vfsmount *mnt) | 73 | static inline int is_mounted(struct vfsmount *mnt) |
74 | { | 74 | { |
75 | /* neither detached nor internal? */ | 75 | /* neither detached nor internal? */ |
76 | return !IS_ERR_OR_NULL(real_mount(mnt)); | 76 | return !IS_ERR_OR_NULL(real_mount(mnt)->mnt_ns); |
77 | } | 77 | } |
78 | 78 | ||
79 | extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int); | 79 | extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int); |