Message ID | 87wpxp70k9.fsf@x220.int.ebiederm.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/namei.c b/fs/namei.c index ae4e4c18b2ac..56a8562899a1 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1409,6 +1409,11 @@ static void follow_dotdot(struct nameidata *nd) break; } if (nd->path.dentry != nd->path.mnt->mnt_root) { + /* Escaped path? */ + if ((nd->path.mnt->mnt_root != nd->path.mnt->mnt_sb->s_root) && + d_ancestor(nd->path.mnt->mnt_root, nd->path.dentry)) + break; + } /* rare case of legitimate dget_parent()... */ nd->path.dentry = dget_parent(nd->path.dentry); dput(old);