[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <175802267623.709179.17067619758138667836.tip-bot2@tip-bot2>
Date: Tue, 16 Sep 2025 11:37:56 -0000
From: "tip-bot2 for Jiri Olsa" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Andrii Nakryiko <andrii@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Oleg Nesterov <oleg@...hat.com>, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: [tip: perf/core] uprobes/x86: Return error from uprobe syscall when
not called from trampoline
The following commit has been merged into the perf/core branch of tip:
Commit-ID: d3aeb6d97b22272bb4783c6d4309d81bb0a4527c
Gitweb: https://git.kernel.org/tip/d3aeb6d97b22272bb4783c6d4309d81bb0a4527c
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Fri, 05 Sep 2025 22:57:29 +02:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Mon, 15 Sep 2025 13:46:29 +02:00
uprobes/x86: Return error from uprobe syscall when not called from trampoline
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>
Signed-off-by: Jiri Olsa <jolsa@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Acked-by: Andrii Nakryiko <andrii@...nel.org>
Acked-by: Oleg Nesterov <oleg@...hat.com>
---
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 0a8c0a4..845aeaf 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;
err = copy_from_user(&args, (void __user *)regs->sp, sizeof(args));
if (err)
Powered by blists - more mailing lists