Re: [PATCH perf/core 09/22] uprobes/x86: Add uprobe syscall to speed up uprobe

Oleg Nesterov
2025-04-27T15:51:57Z

On 04/21, Jiri Olsa wrote:
>
> We do not allow to execute uprobe syscall if the caller is not
> from uprobe trampoline mapping.

...

> +SYSCALL_DEFINE0(uprobe)
> +{
> + struct pt_regs *regs = task_pt_regs(current);
> + unsigned long ip, sp, ax_r11_cx_ip[4];
> + int err;
> +
> + /* Allow execution only from uprobe trampolines. */
> + if (!in_uprobe_trampoline(regs->ip))
> + goto sigill;

I honestly don't understand why do we need this check. Same for the similar
trampoline_check_ip() check in sys_uretprobe(). Nevermind, I won't argue.

Oleg.