diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-15 17:49:26 +0000 |
---|---|---|
committer | Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> | 2016-03-18 01:51:05 +0100 |
commit | 97744e24494326e692a7434fa5b9d390215656b7 (patch) | |
tree | e959429a47af64356a713460cb2814450a671a70 /fs/pnode.c | |
parent | f690db8f59b86ff186e5f818b1340156d74430ad (diff) | |
download | kernel_samsung_smdk4412-97744e24494326e692a7434fa5b9d390215656b7.zip kernel_samsung_smdk4412-97744e24494326e692a7434fa5b9d390215656b7.tar.gz kernel_samsung_smdk4412-97744e24494326e692a7434fa5b9d390215656b7.tar.bz2 |
vfs: more mnt_parent cleanups
a) mount --move is checking that ->mnt_parent is non-NULL before
looking if that parent happens to be shared; ->mnt_parent is never
NULL and it's not even an misspelled !mnt_has_parent()
b) pivot_root open-codes is_path_reachable(), poorly.
c) so does path_is_under(), while we are at it.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
(backported from commit afac7cba7ed31968a95e181dc25e204e45009ea8)
CVE-2014-7970
BugLink: http://bugs.launchpad.net/bugs/1383356
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Change-Id: I6b2297f46388f135c1b760a37d45efc0e33542db
Diffstat (limited to 'fs/pnode.c')
-rw-r--r-- | fs/pnode.c | 15 |
1 files changed, 0 insertions, 15 deletions
@@ -28,21 +28,6 @@ static inline struct vfsmount *next_slave(struct vfsmount *p) return list_entry(p->mnt_slave.next, struct vfsmount, mnt_slave); } -/* - * Return true if path is reachable from root - * - * namespace_sem is held, and mnt is attached - */ -static bool is_path_reachable(struct vfsmount *mnt, struct dentry *dentry, - const struct path *root) -{ - while (mnt != root->mnt && mnt_has_parent(mnt)) { - dentry = mnt->mnt_mountpoint; - mnt = mnt->mnt_parent; - } - return mnt == root->mnt && is_subdir(dentry, root->dentry); -} - static struct vfsmount *get_peer_under_root(struct vfsmount *mnt, struct mnt_namespace *ns, const struct path *root) |