public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/ibt: make is_endbr() notrace
@ 2025-09-18 12:09 Menglong Dong
  2025-09-18 13:05 ` Peter Zijlstra
                   ` (2 more replies)
  0 siblings, 3 replies; 32+ messages in thread
From: Menglong Dong @ 2025-09-18 12:09 UTC (permalink / raw)
  To: peterz, jolsa
  Cc: tglx, mingo, bp, dave.hansen, x86, hpa, kees, samitolvanen, rppt,
	luto, mhiramat, ast, andrii, linux-kernel, bpf

is_endbr() is called in __ftrace_return_to_handler -> fprobe_return ->
kprobe_multi_link_exit_handler -> is_endbr.

It is not protected by the "bpf_prog_active", so it can't be traced by
kprobe-multi, which can cause recurring and panic the kernel. Fix it by
make it notrace.

Fixes: 72e213a7ccf9 ("x86/ibt: Clean up is_endbr()")
Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
---
 arch/x86/kernel/alternative.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 69fb818df2ee..f67a31c77c89 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1108,7 +1108,7 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end) { }
 
 #ifdef CONFIG_X86_KERNEL_IBT
 
-__noendbr bool is_endbr(u32 *val)
+__noendbr notrace bool is_endbr(u32 *val)
 {
 	u32 endbr;
 
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2025-09-24 22:59 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 12:09 [PATCH] x86/ibt: make is_endbr() notrace Menglong Dong
2025-09-18 13:05 ` Peter Zijlstra
2025-09-18 13:32   ` Menglong Dong
2025-09-18 16:02     ` Alexei Starovoitov
2025-09-18 16:59       ` Peter Zijlstra
2025-09-18 17:53         ` Alexei Starovoitov
2025-09-19  1:13           ` Menglong Dong
2025-09-22  6:52             ` Peter Zijlstra
2025-09-22  7:13               ` menglong.dong
2025-09-22  7:19                 ` Peter Zijlstra
2025-09-22  7:21                   ` Menglong Dong
2025-09-22  6:36           ` Peter Zijlstra
2025-09-18 16:56     ` Peter Zijlstra
2025-09-19 12:35       ` Masami Hiramatsu
2025-09-19  8:52 ` Masami Hiramatsu
2025-09-19  8:58   ` Menglong Dong
2025-09-19 12:32     ` Masami Hiramatsu
2025-09-19 11:57 ` [PATCH] tracing: fgraph: Protect return handler from recursion loop Masami Hiramatsu (Google)
2025-09-19 15:27   ` Steven Rostedt
2025-09-20  7:45     ` Jiri Olsa
2025-09-22  6:16       ` Masami Hiramatsu
2025-09-22 13:38         ` Jiri Olsa
2025-09-22 14:42           ` Steven Rostedt
2025-09-22 19:45           ` Jiri Olsa
2025-09-21  4:05     ` Masami Hiramatsu
2025-09-21 22:52       ` Steven Rostedt
2025-09-24 22:58         ` Masami Hiramatsu
2025-09-20 13:39   ` Menglong Dong
2025-09-21  4:06     ` Masami Hiramatsu
2025-09-21 23:00       ` Steven Rostedt
2025-09-24 22:59         ` Masami Hiramatsu
2025-09-22  5:19     ` Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox