All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org, x86@kernel.org,
	"Song Liu" <songliubraving@fb.com>, "Yonghong Song" <yhs@fb.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Hao Luo" <haoluo@google.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Alan Maguire" <alan.maguire@oracle.com>,
	"David Laight" <David.Laight@ACULAB.COM>,
	"Thomas Weißschuh" <thomas@t-8ch.de>,
	"Ingo Molnar" <mingo@kernel.org>, "Jann Horn" <jannh@google.com>,
	"Alejandro Colomar" <alx@kernel.org>
Subject: Re: [PATCH perf/core 1/3] uprobes/x86: Return error from uprobe syscall when not called from trampoline
Date: Mon, 8 Sep 2025 13:25:37 +0200	[thread overview]
Message-ID: <20250908112536.GA5489@redhat.com> (raw)
In-Reply-To: <20250905205731.1961288-2-jolsa@kernel.org>

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@kernel.org>
> Acked-by: Andrii Nakryiko <andrii@kernel.org>
> Signed-off-by: Jiri Olsa <jolsa@kernel.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@redhat.com>


  reply	other threads:[~2025-09-08 11:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 20:57 [PATCH perf/core 0/3] uprobes/x86: change error path for uprobe syscall Jiri Olsa
2025-09-05 20:57 ` [PATCH perf/core 1/3] uprobes/x86: Return error from uprobe syscall when not called from trampoline Jiri Olsa
2025-09-08 11:25   ` Oleg Nesterov [this message]
2025-09-16 11:37   ` [tip: perf/core] " tip-bot2 for Jiri Olsa
2025-09-05 20:57 ` [PATCH perf/core 2/3] selftests/bpf: Fix uprobe_sigill test for uprobe syscall error value Jiri Olsa
2025-09-05 21:40   ` Andrii Nakryiko
2025-09-16 11:37   ` [tip: perf/core] " tip-bot2 for Jiri Olsa
2025-09-05 20:57 ` [PATCH 3/3] man2: Add uprobe syscall page Jiri Olsa
2025-09-15 11:47 ` [PATCH perf/core 0/3] uprobes/x86: change error path for uprobe syscall Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250908112536.GA5489@redhat.com \
    --to=oleg@redhat.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=alan.maguire@oracle.com \
    --cc=alx@kernel.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=haoluo@google.com \
    --cc=jannh@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=songliubraving@fb.com \
    --cc=thomas@t-8ch.de \
    --cc=x86@kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.