linux/virt/kvm
Jim Mattson 9be6111a69 KVM: nVMX: Fix memory corruption when using VMCS shadowing
commit 2f1fe81123 upstream.

When freeing the nested resources of a vcpu, there is an assumption that
the vcpu's vmcs01 is the current VMCS on the CPU that executes
nested_release_vmcs12(). If this assumption is violated, the vcpu's
vmcs01 may be made active on multiple CPUs at the same time, in
violation of Intel's specification. Moreover, since the vcpu's vmcs01 is
not VMCLEARed on every CPU on which it is active, it can linger in a
CPU's VMCS cache after it has been freed and potentially
repurposed. Subsequent eviction from the CPU's VMCS cache on a capacity
miss can result in memory corruption.

It is not sufficient for vmx_free_vcpu() to call vmx_load_vmcs01(). If
the vcpu in question was last loaded on a different CPU, it must be
migrated to the current CPU before calling vmx_load_vmcs01().

Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2016-11-20 01:16:51 +00:00
..
arm arm/arm64: KVM: Keep elrsr/aisr in sync with software model 2015-05-20 13:25:54 +01:00
assigned-dev.c kvm: Use pci_enable_msix_exact() instead of pci_enable_msix() 2014-04-28 11:13:06 +02:00
async_pf.c KVM: async_pf: do not warn on page allocation failures 2016-03-08 12:15:30 +00:00
async_pf.h KVM: Halt vcpu if page it tries to access is swapped out 2011-01-12 11:21:39 +02:00
coalesced_mmio.c KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio() 2014-01-30 11:56:09 +01:00
coalesced_mmio.h KVM: Make coalesced mmio use a device per zone 2011-09-25 19:17:57 +03:00
eventfd.c kvm: fix double free for fast mmio eventfd 2015-10-06 11:52:28 +01:00
ioapic.c KVM: x86: always exit on EOIs for interrupts listed in the IOAPIC redir table 2014-09-05 16:36:32 -07:00
ioapic.h kvm: make local functions static 2014-01-08 19:02:58 -02:00
iodev.h KVM: remove in_range from io devices 2009-09-10 08:33:05 +03:00
iommu.c kvm: fix excessive pages un-pinning in kvm_iommu_map error path. 2014-11-05 11:43:13 +00:00
irq_comm.c kvm/irqchip: Speed up KVM_SET_GSI_ROUTING 2014-05-05 16:29:11 +02:00
irqchip.c KVM: irqfd: fix NULL pointer dereference in kvm_irq_map_gsi 2016-08-22 22:38:08 +01:00
Kconfig KVM: async_pf: Provide additional direct page notification 2014-01-30 12:51:38 +01:00
kvm_main.c KVM: nVMX: Fix memory corruption when using VMCS shadowing 2016-11-20 01:16:51 +00:00
vfio.c kvm/vfio: Support for DMA coherent IOMMUs 2014-02-26 11:38:40 -07:00