Re: [PATCH bpf] bpf: reject override_return programs on uprobe_multi links

From: Alexei Starovoitov

Date: Mon Nov 23 2026 - 22:38:21 EST


On Thu, Nov 19, 2026 at 08:41 AM Sechang Lim <rhkrqnwk98@xxxxxxxxx> wrote:
> bpf_override_return() changes pt_regs->ip to the kernel's
> just_return_func for kprobe error injection. Perf uprobes reject
> programs using this helper, but uprobe_multi links accept them even
> though their pt_regs belong to a user task. When the probe runs, the
> task returns to user mode with a kernel address as its instruction
> pointer, faults, and exposes that address in its signal frame.

That's not a bug. The prog needs CAP_BPF + CAP_PERFMON.

pw-bot: cr