diff mbox series

[4.19,3/5] arm64: fix for bad_mode() handler to always result in panic

Message ID 20191126134830.12747-3-lee.jones@linaro.org
State Superseded
Headers show
Series [4.19,1/5] ARM: 8904/1: skip nomap memblocks while finding the lowmem/highmem boundary | expand

Commit Message

Lee Jones Nov. 26, 2019, 1:48 p.m. UTC
From: Hari Vyas <hari.vyas@broadcom.com>


[ Upstream commit 64cd64a02fc8bb23916ee8841ef510f2f1f2540c ]

The bad_mode() handler is called if we encounter an uunknown exception,
with the expectation that the subsequent call to panic() will halt the
system. Unfortunately, if the exception calling bad_mode() is taken from
EL0, then the call to die() can end up killing the current user task and
calling schedule() instead of falling through to panic().

Remove the die() call altogether, since we really want to bring down the
machine in this "impossible" case.

Signed-off-by: Hari Vyas <hari.vyas@broadcom.com>

Signed-off-by: Will Deacon <will.deacon@arm.com>

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 arch/arm64/kernel/traps.c | 1 -
 1 file changed, 1 deletion(-)

-- 
2.24.0
diff mbox series

Patch

diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index a4e49e947684..5ae9c86c30d1 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -648,7 +648,6 @@  asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
 		handler[reason], smp_processor_id(), esr,
 		esr_get_class_string(esr));
 
-	die("Oops - bad mode", regs, 0);
 	local_irq_disable();
 	panic("bad mode");
 }