Re: [PATCH] uprobes: Skip breakpoint installation on non executable vmas
From: Sumanth Korikkar <hidden>
Date: 2026-08-05 22:05:13
Also in:
lkml
quoted
Even though it's the same file offset, it is mapped to two different virtual addresses, so I think it should be two different memory pages that will have two separate int3 instructions. I don't think there is any contradiction or surprise, is there?True. cross checked the behaviour with bpftrace stacktrace. Pasted the output in previous thread.
I meant to say the following in response to your reply: "Even though it's the same file offset, it is mapped to two different virtual addresses, so I think it should be two different memory pages that will have two separate int3 instructions." Right, and traced this behaviour using bpftrace stacktrace. stacktrace is pasted in the previous thread.
quoted
quoted
quoted
Installing a breakpoint for mapping without VM_EXEC and updating usdt reference counter in that case is not useful. Skip non VM_EXEC mappings in install_breakpoint(). This fixes semaphore double increment as shown in the above usecase.You said that mapping is VM_MAYEXEC, which means that kernel allows to re-mmap it as executable, if that happens, we will miss uprobe in that location, so that's probably why breakpoint is installed for VM_MAYEXEC.
ref commit 78a320542e6c ("uprobes: Change valid_vma() to demand
VM_MAYEXEC rather than VM_EXEC")
Thank you