auxv: require the target to be tracable (or yourself)
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 16 Feb 2011 03:52:11 +0000 (22:52 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 23 Mar 2011 20:36:52 +0000 (16:36 -0400)
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>
fs/proc/base.c

index fc471b8766d197d79dacd9c1f4c9571147595441..e94b58b496f13addafecc15043b646a176e75cef 100644 (file)
@@ -281,9 +281,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;