aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/dcache.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 8a35300..46265f5 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2452,6 +2452,8 @@ static int prepend_path(const struct path *path,
{
struct dentry *dentry = path->dentry;
struct vfsmount *vfsmnt = path->mnt;
+ char *orig_buffer = *buffer;
+ int orig_len = *buflen;
bool slash = false;
int error = 0;
@@ -2459,6 +2461,14 @@ static int prepend_path(const struct path *path,
struct dentry * parent;
if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
+ /* Escaped? */
+ if (dentry != vfsmnt->mnt_root) {
+ *buffer = orig_buffer;
+ *buflen = orig_len;
+ slash = false;
+ error = 3;
+ goto global_root;
+ }
/* Global root? */
if (vfsmnt->mnt_parent == vfsmnt) {
goto global_root;