浏览代码

auxv: require the target to be tracable (or yourself)

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>
Al Viro 14 年之前
父节点
当前提交
2fadaef412
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      fs/proc/base.c

+ 3 - 3
fs/proc/base.c

@@ -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;