[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250908112536.GA5489@redhat.com>
Date: Mon, 8 Sep 2025 13:25:37 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Jiri Olsa <jolsa@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
Andrii Nakryiko <andrii@...nel.org>, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
x86@...nel.org, Song Liu <songliubraving@...com>,
Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
Hao Luo <haoluo@...gle.com>, Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Alan Maguire <alan.maguire@...cle.com>,
David Laight <David.Laight@...LAB.COM>,
Thomas Weißschuh <thomas@...ch.de>,
Ingo Molnar <mingo@...nel.org>, Jann Horn <jannh@...gle.com>,
Alejandro Colomar <alx@...nel.org>
Subject: Re: [PATCH perf/core 1/3] uprobes/x86: Return error from uprobe
syscall when not called from trampoline
On 09/05, Jiri Olsa wrote:
>
> Currently uprobe syscall handles all errors with forcing SIGILL to current
> process. As suggested by Andrii it'd be helpful for uprobe syscall detection
> to return error value for the !in_uprobe_trampoline check.
>
> This way we could just call uprobe syscall and based on return value we will
> find out if the kernel has it.
>
> Suggested-by: Andrii Nakryiko <andrii@...nel.org>
> Acked-by: Andrii Nakryiko <andrii@...nel.org>
> Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> ---
> arch/x86/kernel/uprobes.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
> index 0a8c0a4a5423..845aeaf36b8d 100644
> --- a/arch/x86/kernel/uprobes.c
> +++ b/arch/x86/kernel/uprobes.c
> @@ -810,7 +810,7 @@ SYSCALL_DEFINE0(uprobe)
>
> /* Allow execution only from uprobe trampolines. */
> if (!in_uprobe_trampoline(regs->ip))
> - goto sigill;
> + return -ENXIO;
I agree.
Acked-by: Oleg Nesterov <oleg@...hat.com>
Powered by blists - more mailing lists