Re: [PATCH bpf-next 4/9] uprobes/x86: Don't WARN if an optimized probe can't be written
From: Jann Horn
Date: Thu Oct 22 2026 - 13:58:11 EST
On Thu, Oct 22, 2026 at 3:57 AM Alexei Starovoitov
<alexei.starovoitov@xxxxxxxxx> wrote:
> @@ -1197,7 +1194,7 @@ static int __arch_uprobe_optimize(struct arch_uprobe *auprobe, struct mm_struct
> if (IS_ERR(tramp))
> return PTR_ERR(tramp);
> ret = swbp_optimize(auprobe, vma, vaddr, tramp->vm_start);
> - if (WARN_ON_ONCE(ret) && new_mapping)
> + if (ret && new_mapping)
> WARN_ON_ONCE(do_munmap(mm, tramp->vm_start, PAGE_SIZE, NULL));
Not an issue with your patch, just FYI regarding this preexisting
WARN_ON_ONCE():
A failing small GFP_KERNEL allocation could theoretically cause
do_munmap() to fail; the VMA tree has the ugly quirk that you can't
reliably _remove_ elements without memory allocation.