Skip to content

Commit 2288397

Browse files
kiryltorvalds
authored andcommitted
mm: Fix access_remote_vm() regression on tagged addresses
GDB uses /proc/PID/mem to access memory of the target process. GDB doesn't untag addresses manually, but relies on kernel to do the right thing. mem_rw() of procfs uses access_remote_vm() to get data from the target process. It worked fine until recent changes in __access_remote_vm() that now checks if there's VMA at target address using raw address. Untag the address before looking up the VMA. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Reported-by: Christina Schimpe <christina.schimpe@intel.com> Fixes: eee9c70 ("gup: avoid stack expansion warning for known-good case") Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 77245f1 commit 2288397

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mm/memory.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5705,6 +5705,9 @@ int __access_remote_vm(struct mm_struct *mm, unsigned long addr, void *buf,
57055705
if (mmap_read_lock_killable(mm))
57065706
return 0;
57075707

5708+
/* Untag the address before looking up the VMA */
5709+
addr = untagged_addr_remote(mm, addr);
5710+
57085711
/* Avoid triggering the temporary warning in __get_user_pages */
57095712
if (!vma_lookup(mm, addr) && !expand_stack(mm, addr))
57105713
return 0;

0 commit comments

Comments
 (0)