]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
KVM: VMX: check validity of VMCS controls when returning from SMM
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 9 Mar 2026 11:40:40 +0000 (12:40 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Mar 2026 17:41:11 +0000 (18:41 +0100)
commit5a30e8aea079b3e4e79d6ce7a878f5f42efe9d0b
tree702274b8a57151777de32dd1ff76c4381cc76f0c
parent87d0f901a9bd8ae6be57249c737f20ac0cace93d
KVM: VMX: check validity of VMCS controls when returning from SMM

The VMCS12 is not available while in SMM.  However, it can be overwritten
if userspace manages to trigger copy_enlightened_to_vmcs12() - for example
via KVM_GET_NESTED_STATE.

Because of this, the VMCS12 has to be checked for validity before it is
used to generate the VMCS02.  Move the check code out of vmx_set_nested_state()
(the other "not a VMLAUNCH/VMRESUME" path that emulates a nested vmentry)
and reuse it in vmx_leave_smm().

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/nested.h
arch/x86/kvm/vmx/vmx.c