From d9ce5c10ef92577820739ba789164d4c1c8ac755 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Fri, 20 Nov 2009 09:12:22 -0800 Subject: [PATCH] --- yaml --- r: 170039 b: refs/heads/master c: a4054b6b20e9c2cca63715a319759bf8d37d82fc h: refs/heads/master i: 170037: af9db3d705e68198694e6bc22aa43eb55aefd7c1 170035: 5e8a1a08d88ca8bd975bcc63240b9601b51597a4 170031: 0e488e1863e4a1055777b0e3338dc2f1f222e36a v: v3 --- [refs] | 2 +- trunk/security/tomoyo/realpath.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c8b3d4797dac..fd5e24df9b95 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6d4561110a3e9fa742aeec6717248a491dfb1878 +refs/heads/master: a4054b6b20e9c2cca63715a319759bf8d37d82fc diff --git a/trunk/security/tomoyo/realpath.c b/trunk/security/tomoyo/realpath.c index 5f2e33263371..0b55faab3b32 100644 --- a/trunk/security/tomoyo/realpath.c +++ b/trunk/security/tomoyo/realpath.c @@ -108,6 +108,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);