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

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

From: Alexei Starovoitov <hidden>
Date: 2026-05-12 19:27:14
Also in: bpf

On Tue, May 12, 2026 at 10:07 AM Jiri Olsa [off-list ref] wrote:
quoted hunk ↗ jump to hunk

+       /*
+        * We have nop10 (with first byte overwritten to int3),
+        * change it to:
+        *   lea 0x80(%rsp), %rsp
+        *   call tramp
+        *
+        * The first lea instruction skips the stack redzone so the call
+        * instruction can safely push return address on stack.
+        */
typo: lea -128(%rsp), %rsp

you can also do:

add $-128, %rsp + call tramp = 4 + 5 = 9 bytes instead of 10.

Initially I didn't like this approach, since we just introduced
usdt nop5 and now need to recompile everything again,
but looking at the fix it's definitely simpler than alternatives
and doesn't have annoying limitations.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help