[PATCH v2] riscv: kprobes: Prevent probes in breakpoint handlers

Paul Walmsley pjw at kernel.org
Thu Aug 6 10:02:15 PDT 2026


On Thu, 6 Aug 2026, Rui Qi wrote:

> The ftrace selftest multiple_kprobes.tc registers kprobe events on
> the first 256 text symbols from /proc/kallsyms. If handle_break() is
> selected as a probe target on RISC-V, the breakpoint exception path
> can trap again before it reaches the kprobe breakpoint handler. That
> recursively enters do_trap_break() and can make the system
> unresponsive.
> 
> Mark handle_break() and its local probe dispatch helpers as nokprobe
> symbols so they are added to the kprobe blacklist, matching other
> low-level breakpoint exception paths.
> 
> Signed-off-by: Rui Qi <qirui.001 at bytedance.com>
> Reviewed-by: Nam Cao <namcao at linutronix.de>

Thanks, queued for v7.3.


- Paul



More information about the linux-riscv mailing list