提交 2344bec7 编写于 作者: C Cong Wang 提交者: Linus Torvalds

proc: use mm_access() instead of ptrace_may_access()

mm_access() handles this much better, and avoids some race conditions.
Signed-off-by: NCong 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e7dcd999
......@@ -2022,11 +2022,8 @@ static int map_files_d_revalidate(struct dentry *dentry, struct nameidata *nd)
if (!task)
goto out_notask;
if (!ptrace_may_access(task, PTRACE_MODE_READ))
goto out;
mm = get_task_mm(task);
if (!mm)
mm = mm_access(task, PTRACE_MODE_READ);
if (IS_ERR_OR_NULL(mm))
goto out;
if (!dname_to_vma_addr(dentry, &vm_start, &vm_end)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册