patch-2.2.13 linux/fs/proc/array.c

Next file: linux/fs/proc/fd.c
Previous file: linux/fs/open.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/fs/proc/array.c linux/fs/proc/array.c
@@ -899,9 +899,10 @@
 
 	read_lock(&tasklist_lock);
 	tsk = find_task_by_pid(pid);
-	read_unlock(&tasklist_lock);	/* FIXME!! This should be done after the last use */
-	if (!tsk)
+	if (!tsk) {
+		read_unlock(&tasklist_lock);
 		return 0;
+	}
 	state = *get_task_state(tsk);
 	vsize = eip = esp = 0;
 	if (tsk->mm && tsk->mm != &init_mm) {
@@ -910,9 +911,14 @@
 			vsize += vma->vm_end - vma->vm_start;
 			vma = vma->vm_next;
 		}
-		eip = KSTK_EIP(tsk);
-		esp = KSTK_ESP(tsk);
+		if ((current->fsuid == tsk->euid && tsk->dumpable &&
+		    cap_issubset(tsk->cap_permitted, current->cap_permitted)) ||
+		    capable(CAP_DAC_OVERRIDE)) {
+			eip = KSTK_EIP(tsk);
+			esp = KSTK_ESP(tsk);
+		}
 	}
+	read_unlock(&tasklist_lock);	/* FIXME!! This should be done after the last use */
 
 	wchan = get_wchan(tsk);
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)