From 82552e8662f2c0e85e04d4f13cb58a6c85d97528 Mon Sep 17 00:00:00 2001 From: Wei Li Date: Thu, 16 Jan 2020 14:43:24 +0800 Subject: [PATCH] arm64: fix calling nmi_enter() repeatedly when IPI_CPU_CRASH_STOP hulk inclusion category: bugfix bugzilla: 28145 CVE: NA ------------------------------------------------- The nmi_enter() may has been called in el1_irq. When processing IPI_CPU_CRASH_STOP in handle_IPI(), don't call nmi_enter() again if interrupt is disabled (already in NMI context). Fixes: e753aae7e448 ("arm64: Fix interrupt tracing in the presence of NMIs") Signed-off-by: Wei Li Reviewed-by: Hanjun Guo Signed-off-by: Yang Yingliang --- arch/arm64/kernel/smp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 50c98ab8173b..b13a2d207c0a 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -924,9 +924,10 @@ void handle_IPI(int ipinr, struct pt_regs *regs) case IPI_CPU_CRASH_STOP: if (IS_ENABLED(CONFIG_KEXEC_CORE)) { - if (gic_supports_pseudo_nmis()) - nmi_enter(); - else + if (gic_supports_pseudo_nmis()) { + if (irqs_enabled) + nmi_enter(); + } else irq_enter(); ipi_cpu_crash_stop(cpu, regs); -- GitLab