aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/realpath.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2009-12-09 19:01:03 +1100
committerJames Morris <jmorris@namei.org>2009-12-09 19:01:03 +1100
commit1ad1f10cd915744bbe52b19423653b38287d827d (patch)
treeae072aace36b45a55d80b8cbf1b6d92523a88ea0 /security/tomoyo/realpath.c
parentselinux: remove a useless return (diff)
parentMerge branches 'timers-for-linus-ntp' and 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip (diff)
downloadlinux-dev-1ad1f10cd915744bbe52b19423653b38287d827d.tar.xz
linux-dev-1ad1f10cd915744bbe52b19423653b38287d827d.zip
Merge branch 'master' into next
Diffstat (limited to 'security/tomoyo/realpath.c')
-rw-r--r--security/tomoyo/realpath.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c
index 917f564cdab1..18369d497eb8 100644
--- a/security/tomoyo/realpath.c
+++ b/security/tomoyo/realpath.c
@@ -110,6 +110,15 @@ int tomoyo_realpath_from_path2(struct path *path, char *newname,
spin_unlock(&dcache_lock);
path_put(&root);
path_put(&ns_root);
+ /* Prepend "/proc" prefix if using internal proc vfs mount. */
+ if (!IS_ERR(sp) && (path->mnt->mnt_parent == path->mnt) &&
+ (strcmp(path->mnt->mnt_sb->s_type->name, "proc") == 0)) {
+ sp -= 5;
+ if (sp >= newname)
+ memcpy(sp, "/proc", 5);
+ else
+ sp = ERR_PTR(-ENOMEM);
+ }
}
if (IS_ERR(sp))
error = PTR_ERR(sp);