[PATCH] riscv: entry: Fixup do_trap_break from kernel side

Kees Cook kees at kernel.org
Fri Jun 19 16:54:53 PDT 2026


*thread encromancy*

On Sat, Jul 01, 2023 at 10:57:07PM -0400, guoren at kernel.org wrote:
> From: Guo Ren <guoren at linux.alibaba.com>
> 
> The irqentry_nmi_enter/exit would force the current context into in_interrupt.
> That would trigger the kernel to dead panic, but the kdb still needs "ebreak" to
> debug the kernel.
> 
> Move irqentry_nmi_enter/exit to exception_enter/exit could correct handle_break
> of the kernel side.
> 
> Before the fixup:
> $echo BUG > /sys/kernel/debug/provoke-crash/DIRECT
>   lkdtm: Performing direct entry BUG
>   ------------[ cut here ]------------
>   kernel BUG at drivers/misc/lkdtm/bugs.c:78!
> [...]
>   Kernel panic - not syncing: Aiee, killing interrupt handler!

This appears to still be unfixed. What's the blocker? The solutions in
this thread seem to work...

I'd like to be exercising an Oops path via KUnit (for KCFI), and riscv
just instantly falls over instead of thread-killing on the exception.

Thanks!

-Kees

-- 
Kees Cook



More information about the linux-riscv mailing list