Re: [PATCH] uprobes: Skip breakpoint installation on non executable vmas
From: Oleg Nesterov
Date: Thu Aug 06 2026 - 11:37:23 EST
On 08/06, Sumanth Korikkar wrote:
>
> On Thu, Aug 06, 2026 at 01:01:11PM +0200, Oleg Nesterov wrote:
> >
> > But your change in install_breakpoint() essentually reverts that commit?
> > If uprobe_register() -> register_for_each_vma() finds a VM_MAYEXEC vma
> > without VM_EXEC valid_vma() will return true, but then install_breakpoint()
> > will fail anyway.
>
> Initially non exec vma will be ignored via uprobe_register(),
> install_breakpoint() will reject non vma mappings initially.
>
> As far as I understand, if mprotect(PROT_EXEC) is performed later by a
> process, it adds VM_EXEC flag to vma and calls vma_complete() via
> vma_modify_flags(). uprobe_mmap() will then call install_breakpoint()
> and now it should succeed because VM_EXEC is set.
Heh, I am stupid the 2nd time in the same thread ;)
Sumanth, thanks for correcting me! It seems that I forgot everything about
these code paths.
Then this change makes more sense, but the VM_EXEC check needs the comment
to explain this all.
However, I personally still don't think it's worth "fixing". But I leave the
decision to Andrii and Jiri who (unlike me) understand how USDT's are used.
Oleg.