Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157302
b: refs/heads/master
c: a893a84
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and James Morris committed Jun 24, 2009
1 parent 31eb435 commit 86f4e91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9e48858f7d36a6a3849f1d1b40c3bf5624b4ee7c
refs/heads/master: a893a84e8799270fbec5c3708d001650aab47138
23 changes: 11 additions & 12 deletions trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,19 @@ struct mm_struct *mm_for_maps(struct task_struct *task)
struct mm_struct *mm = get_task_mm(task);
if (!mm)
return NULL;
if (mm != current->mm) {
/*
* task->mm can be changed before security check,
* in that case we must notice the change after.
*/
if (!ptrace_may_access(task, PTRACE_MODE_READ) ||
mm != task->mm) {
mmput(mm);
return NULL;
}
}
down_read(&mm->mmap_sem);
task_lock(task);
if (task->mm != mm)
goto out;
if (task->mm != current->mm &&
__ptrace_may_access(task, PTRACE_MODE_READ) < 0)
goto out;
task_unlock(task);
return mm;
out:
task_unlock(task);
up_read(&mm->mmap_sem);
mmput(mm);
return NULL;
}

static int proc_pid_cmdline(struct task_struct *task, char * buffer)
Expand Down

0 comments on commit 86f4e91

Please sign in to comment.