[PATCH] riscv: Avoid enabling interrupts in die()

Björn Töpel bjorn at kernel.org
Wed Feb 15 07:29:25 PST 2023


Mattias Nissler <mnissler at rivosinc.com> writes:

> While working on something else, I noticed that the kernel would start
> accepting interrupts again after crashing in an interrupt handler. Since
> the kernel is already in inconsistent state, enabling interrupts is
> dangerous and opens up risk of kernel state deteriorating further.
> Interrupts do get enabled via what looks like an unintended side effect of
> spin_unlock_irq, so switch to the more cautious
> spin_lock_irqsave/spin_unlock_irqrestore instead.
>
> Fixes: 76d2a0493a17 ("RISC-V: Init and Halt Code")
> Signed-off-by: Mattias Nissler <mnissler at rivosinc.com>

Nice catch!

Reviewed-by: Björn Töpel <bjorn at kernel.org>



More information about the linux-riscv mailing list