aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2015-01-15 17:49:26 +0000
committerZiyan <jaraidaniel@gmail.com>2016-10-29 01:34:21 +0200
commit3900c2b6dcee9198e4e03abfecdedd1c30f68c0f (patch)
treec682e45c124c895f14ab9123092753603c0102b7 /fs/dcache.c
parentd478a9dac767ad4e3c2e2dd3d141c6165387a117 (diff)
downloadkernel_samsung_tuna-3900c2b6dcee9198e4e03abfecdedd1c30f68c0f.zip
kernel_samsung_tuna-3900c2b6dcee9198e4e03abfecdedd1c30f68c0f.tar.gz
kernel_samsung_tuna-3900c2b6dcee9198e4e03abfecdedd1c30f68c0f.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/dcache.c')
-rw-r--r--fs/dcache.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 57e163b..deb6f6a 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2919,31 +2919,6 @@ int is_subdir(struct dentry *new_dentry, struct dentry *old_dentry)
return result;
}
-int path_is_under(struct path *path1, struct path *path2)
-{
- struct vfsmount *mnt = path1->mnt;
- struct dentry *dentry = path1->dentry;
- int res;
-
- br_read_lock(&vfsmount_lock);
- if (mnt != path2->mnt) {
- for (;;) {
- if (!mnt_has_parent(mnt)) {
- br_read_unlock(&vfsmount_lock);
- return 0;
- }
- if (mnt->mnt_parent == path2->mnt)
- break;
- mnt = mnt->mnt_parent;
- }
- dentry = mnt->mnt_mountpoint;
- }
- res = is_subdir(dentry, path2->dentry);
- br_read_unlock(&vfsmount_lock);
- return res;
-}
-EXPORT_SYMBOL(path_is_under);
-
void d_genocide(struct dentry *root)
{
struct dentry *this_parent;