In the Linux kernel, the following vulnerability has been resolved:
KVM: nVMX: Always make an attempt to map eVMCS after migration
When enlightened VMCS is in use and nested state is migrated with vmxgetnestedstate()/vmxsetnestedstate() KVM can't map evmcs page right away: evmcs gpa is not 'struct kvmvmxnestedstatehdr' and we can't read it from VP assist page because userspace may decide to restore HVX64MSRVPASSISTPAGE after restoring nested state (and QEMU, for example, does exactly that). To make sure eVMCS is mapped /vmxsetnestedstate() raises KVMREQGETNESTEDSTATE_PAGES request.
Commit f2c7ef3ba955 ("KVM: nSVM: cancel KVMREQGETNESTEDSTATEPAGES on nested vmexit") added KVMREQGETNESTEDSTATEPAGES clearing to nestedvmxvmexit() to make sure MSR permission bitmap is not switched when an immediate exit from L2 to L1 happens right after migration (caused by a pending event, for example). Unfortunately, in the exact same situation we still need to have eVMCS mapped so nestedsyncvmcs12toshadow() reflects changes in VMCS12 to eVMCS.
As a band-aid, restore nestedgetevmcspage() when clearing KVMREQGETNESTEDSTATEPAGES in nestedvmxvmexit(). The 'fix' is far from being ideal as we can't easily propagate possible failures and even if we could, this is most likely already too late to do so. The whole 'KVMREQGETNESTEDSTATEPAGES' idea for mapping eVMCS after migration seems to be fragile as we diverge too much from the 'native' path when vmptr loading happens on vmxsetnestedstate().