Thread (18 messages) 18 messages, 4 authors, 2019-03-20
STALE2631d
Revisions (11)
  1. v6 [diff vs current]
  2. v10 [diff vs current]
  3. v11 [diff vs current]
  4. v12 current
  5. v13 [diff vs current]
  6. v14 [diff vs current]
  7. v15 [diff vs current]
  8. v16 [diff vs current]
  9. v17 [diff vs current]
  10. v18 [diff vs current]
  11. v19 [diff vs current]

[PATCH v12 11/13] uprobes, arm64: untag user pointers in find_active_uprobe

From: Andrey Konovalov <hidden>
Date: 2019-03-18 17:18:27
Also in: bpf, linux-arch, linux-arm-kernel, linux-doc, linux-kselftest, linux-mm, lkml
Subsystem: performance events subsystem, the rest, uprobes · Maintainers: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo, Namhyung Kim, Linus Torvalds, Masami Hiramatsu, Oleg Nesterov

This patch is a part of a series that extends arm64 kernel ABI to allow to
pass tagged user pointers (with the top byte set to something else other
than 0x00) as syscall arguments.

find_active_uprobe() uses provided user pointer (obtained via
instruction_pointer(regs)) for vma lookups, which can only by done with
untagged pointers.

Untag the user pointer in this function.

Signed-off-by: Andrey Konovalov <redacted>
---
 kernel/events/uprobes.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index c5cde87329c7..d3a2716a813a 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1992,6 +1992,8 @@ static struct uprobe *find_active_uprobe(unsigned long bp_vaddr, int *is_swbp)
 	struct uprobe *uprobe = NULL;
 	struct vm_area_struct *vma;
 
+	bp_vaddr = untagged_addr(bp_vaddr);
+
 	down_read(&mm->mmap_sem);
 	vma = find_vma(mm, bp_vaddr);
 	if (vma && vma->vm_start <= bp_vaddr) {
-- 
2.21.0.225.g810b269d1ac-goog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help