From 4452cb8252bac5d3e4b0717365226f3cc237d5fe Mon Sep 17 00:00:00 2001 From: Wei Li Date: Wed, 13 Feb 2019 19:53:55 +0800 Subject: [PATCH] arm64: fix potential deadlock in arm64-provide-pseudo-NMI-with-GICv3 hulk inclusion category: bugfix bugzilla: 9291 CVE: NA -------------------------------- In some exception handlers, the interrupt is not reenabled by daifclr at first. The later process may call local_irq_enable() to enable the interrupt, like gic_handle_irq(). As we known, function local_irq_enable() just change the pmr now. The following codes what i found may cause a deadlock or some issues else. Signed-off-by: Wei Li Reviewed-by: Hanjun Guo Signed-off-by: Yang Yingliang --- arch/arm64/kernel/kgdb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c index a20de58061a8..119fbf2c0788 100644 --- a/arch/arm64/kernel/kgdb.c +++ b/arch/arm64/kernel/kgdb.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -291,6 +292,9 @@ static void kgdb_call_nmi_hook(void *ignored) void kgdb_roundup_cpus(unsigned long flags) { + if (gic_prio_masking_enabled()) + gic_arch_enable_irqs(); + local_irq_enable(); smp_call_function(kgdb_call_nmi_hook, NULL, 0); local_irq_disable(); -- GitLab