Commit fd2c1e6e authored by Mattias Nissler's avatar Mattias Nissler Committed by sanglipeng
Browse files

riscv: Avoid enabling interrupts in die()

stable inclusion
from stable-v5.10.175
commit 713c335e5a8f1e65dbe9980ed77d8ae4c0364c34
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8711T

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=713c335e5a8f1e65dbe9980ed77d8ae4c0364c34



--------------------------------

[ Upstream commit 130aee3f ]

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: 76d2a049 ("RISC-V: Init and Halt Code")
Signed-off-by: default avatarMattias Nissler <mnissler@rivosinc.com>
Reviewed-by: default avatarBjörn Töpel <bjorn@kernel.org>
Link: https://lore.kernel.org/r/20230215144828.3370316-1-mnissler@rivosinc.com


Cc: stable@vger.kernel.org
Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent ce574054
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment