Re: [PATCH 1/2] x86/crash: Disable virt in core NMI crash handler to avoid double list_add

Thomas Gleixner
2022-05-12T15:49:05Z

On Thu, May 12 2022 at 14:14, Sean Christopherson wrote:
> On Thu, May 12, 2022, Thomas Gleixner wrote:
> diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
> index 4e3a839ae146..808d3e75fb2d 100644
> --- a/arch/x86/kernel/reboot.c
> +++ b/arch/x86/kernel/reboot.c
> @@ -896,7 +896,11 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback)
> msecs--;
> }
>
> - /* Leave the nmi callback set */
> + /*
> + * Leave the nmi callback set, shootdown is a one-time thing. Clearing
> + * the callback could result in a NULL pointer dereference if a CPU
> + * (finally) responds after the timeout expires.
> + */

Good point!