Patchwork [lucid,lucid/fsl-imx51,CVE,4/5] auxv: require the target to be tracable (or yourself)

login
register
mail settings
Submitter Andy Whitcroft
Date July 21, 2011, 1:13 p.m.
Message ID <1311254026-29719-6-git-send-email-apw@canonical.com>
Download mbox | patch
Permalink /patch/106043/
State New
Headers show

Comments

Andy Whitcroft - July 21, 2011, 1:13 p.m.
From: Al Viro <viro@zeniv.linux.org.uk>

same as for environ, except that we didn't do any checks to
prevent access after suid execve

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

(cherry picked from commit 2fadaef41283aad7100fa73f01998cddaca25833)
CVE-2011-1020
BugLink: http://bugs.launchpad.net/bugs/813026
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
 fs/proc/base.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 837713d..e901438 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -291,9 +291,9 @@  out:
 
 static int proc_pid_auxv(struct task_struct *task, char *buffer)
 {
-	int res = 0;
-	struct mm_struct *mm = get_task_mm(task);
-	if (mm) {
+	struct mm_struct *mm = mm_for_maps(task);
+	int res = PTR_ERR(mm);
+	if (mm && !IS_ERR(mm)) {
 		unsigned int nwords = 0;
 		do {
 			nwords += 2;