Re: [PATCH v2 0/3] x86/crash: Fix double NMI shootdown bug

From: Sean Christopherson
Date: Fri Jul 08 2022 - 19:28:47 EST


On Wed, May 18, 2022, Sean Christopherson wrote:
> Fix a double NMI shootdown bug found and debugged by Guilherme, who did all
> the hard work. NMI shootdown is a one-time thing; the handler leaves NMIs
> blocked and enters halt. At best, a second (or third...) shootdown is an
> expensive nop, at worst it can hang the kernel and prevent kexec'ing into
> a new kernel, e.g. prior to the hardening of register_nmi_handler(), a
> double shootdown resulted in a double list_add(), which is fatal when running
> with CONFIG_BUG_ON_DATA_CORRUPTION=y.

...

> Sean Christopherson (3):
> x86/crash: Disable virt in core NMI crash handler to avoid double
> shootdown
> x86/reboot: Disable virtualization in an emergency if SVM is supported
> x86/virt: Fold __cpu_emergency_vmxoff() into its sole caller
>
> arch/x86/include/asm/reboot.h | 1 +
> arch/x86/include/asm/virtext.h | 14 +-----
> arch/x86/kernel/crash.c | 16 +-----
> arch/x86/kernel/reboot.c | 89 +++++++++++++++++++++++++---------
> 4 files changed, 69 insertions(+), 51 deletions(-)

Ping! Still applies cleanly.