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

Nam Cao namcao at linutronix.de
Mon Aug 3 23:56:19 PDT 2026


"Rui Qi" <qirui.001 at bytedance.com> writes:
> diff --git a/arch/riscv/kernel/traps.c b/arch/riscv/kernel/traps.c
> index 2f57fd48ec28..5eb5785874dd 100644
> --- a/arch/riscv/kernel/traps.c
> +++ b/arch/riscv/kernel/traps.c
> @@ -270,6 +270,8 @@ static bool probe_single_step_handler(struct pt_regs *regs)
>  	return user ? uprobe_single_step_handler(regs) : kprobe_single_step_handler(regs);
>  }
>  
> +NOKPROBE_SYMBOL(probe_single_step_handler);
> +

The usual style is NOKPROBE_SYMBOL() following the function with no
blank line.

Other than that:
Reviewed-by: Nam Cao <namcao at linutronix.de>



More information about the linux-riscv mailing list