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

From: Paul Walmsley

Date: Thu Aug 06 2026 - 13:18:10 EST


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@xxxxxxxxxxxxx>
> Reviewed-by: Nam Cao <namcao@xxxxxxxxxxxxx>

Thanks, queued for v7.3.


- Paul