Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2344bec7 authored by Cong Wang's avatar Cong Wang Committed by Linus Torvalds
Browse files

proc: use mm_access() instead of ptrace_may_access()



mm_access() handles this much better, and avoids some race conditions.

Signed-off-by: default avatarCong 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e7dcd999
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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)) {