diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2012-05-31 19:26:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 20:49:29 -0400 |
commit | 2344bec788b097b2d1198758bd29c583812b864e (patch) | |
tree | 3ffcf64931b7935ee4e16b81fb6ec6b732436dfa /fs/proc/base.c | |
parent | e7dcd9990e42ccfc798d4eb55e2dbf9d7d434c6b (diff) |
proc: use mm_access() instead of ptrace_may_access()
mm_access() handles this much better, and avoids some race conditions.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index cca635d252d4..155dee600ed4 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2022,11 +2022,8 @@ static int map_files_d_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
2022 | if (!task) | 2022 | if (!task) |
2023 | goto out_notask; | 2023 | goto out_notask; |
2024 | 2024 | ||
2025 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) | 2025 | mm = mm_access(task, PTRACE_MODE_READ); |
2026 | goto out; | 2026 | if (IS_ERR_OR_NULL(mm)) |
2027 | |||
2028 | mm = get_task_mm(task); | ||
2029 | if (!mm) | ||
2030 | goto out; | 2027 | goto out; |
2031 | 2028 | ||
2032 | if (!dname_to_vma_addr(dentry, &vm_start, &vm_end)) { | 2029 | if (!dname_to_vma_addr(dentry, &vm_start, &vm_end)) { |