Thread (13 messages) 13 messages, 6 authors, 2026-05-13

Re: [PATCH bpf 1/2] uprobes/x86: Fix red zone clobbering in nop5 optimization

flat view

From: Andrii Nakryiko <hidden>
Date: 2026-05-11 16:56:26
Also in: bpf

On Mon, May 11, 2026 at 7:45 AM Oleg Nesterov [off-list ref] wrote:
On 05/08, Andrii Nakryiko wrote:
quoted

+static bool resolve_uprobe_addr(unsigned long ip, unsigned long *probe_addr)
 {
-     struct vm_area_struct *vma = vma_lookup(current->mm, ip);
+     struct uprobes_state *state = &current->mm->uprobes_state;
it seems that there is a problem, with or without this change...

Lets forget about this patch for the moment, I am still trying to understand it.

What if register_for_each_vma() calls install_breakpoint(vma) and
vma->mm != current->mm ?

In this case install_breakpoint() path will call __is_optimized() and then
__in_uprobe_trampoline() which does vma_lookup(current->mm). This looks
obviously wrong ?

And unless I am totally confused, this patch "inherits" the problem...

No?
Yes, sashiko called this out as well. I'm going to pass mm explicitly
into is_optimized and all the way to resolve_uprobe_addr(), easy fix.

But we should have a stand-alone easily backportable fix for this even
without my changes, yes. I can add it as pre-patch or send separately.
Oleg.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help