[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <172443886668.4129032.11970184788806787426.b4-ty@google.com>
Date: Fri, 23 Aug 2024 16:48:09 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>, Vitaly Kuznetsov <vkuznets@...hat.com>
Cc: Mirsad Todorovac <mtodorovac69@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: VMX: hyper-v: Prevent impossible NULL pointer
dereference in evmcs_load()
On Fri, 16 Aug 2024 15:01:24 +0200, Vitaly Kuznetsov wrote:
> GCC 12.3.0 complains about a potential NULL pointer dereference in
> evmcs_load() as hv_get_vp_assist_page() can return NULL. In fact, this
> cannot happen because KVM verifies (hv_init_evmcs()) that every CPU has a
> valid VP assist page and aborts enabling the feature otherwise. CPU
> onlining path is also checked in vmx_hardware_enable().
>
> To make the compiler happy and to future proof the code, add a KVM_BUG_ON()
> sentinel. It doesn't seem to be possible (and logical) to observe
> evmcs_load() happening without an active vCPU so it is presumed that
> kvm_get_running_vcpu() can't return NULL.
>
> [...]
Applied to kvm-x86 vmx, thanks!
[1/1] KVM: VMX: hyper-v: Prevent impossible NULL pointer dereference in evmcs_load()
https://github.com/kvm-x86/linux/commit/2ab637df5f68
--
https://github.com/kvm-x86/linux/tree/next
Powered by blists - more mailing lists