linux-stable/arch/x86
Sean Christopherson 9a1d0eee59 KVM: nVMX: Unconditionally purge queued/injected events on nested "exit"
commit d953540430 upstream.

Drop pending exceptions and events queued for re-injection when leaving
nested guest mode, even if the "exit" is due to VM-Fail, SMI, or forced
by host userspace.  Failure to purge events could result in an event
belonging to L2 being injected into L1.

This _should_ never happen for VM-Fail as all events should be blocked by
nested_run_pending, but it's possible if KVM, not the L1 hypervisor, is
the source of VM-Fail when running vmcs02.

SMI is a nop (barring unknown bugs) as recognition of SMI and thus entry
to SMM is blocked by pending exceptions and re-injected events.

Forced exit is definitely buggy, but has likely gone unnoticed because
userspace probably follows the forced exit with KVM_SET_VCPU_EVENTS (or
some other ioctl() that purges the queue).

Fixes: 4f350c6dbc ("kvm: nVMX: Handle deferred early VMLAUNCH/VMRESUME failure properly")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20220830231614.3580124-2-seanjc@google.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-10-21 12:37:54 +02:00
..
boot x86/boot: Don't propagate uninitialized boot_params->cc_blob_address 2022-08-24 09:03:04 +02:00
coco x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page 2022-06-17 15:37:33 -07:00
configs xen: branch for v6.0-rc3 2022-08-27 15:38:00 -07:00
crypto SPDX changes for 6.0-rc1 2022-08-04 12:12:54 -07:00
entry x86/entry: Fix entry_INT80_compat for Xen PV guests 2022-08-16 10:02:52 +02:00
events PCI interpretation compile fixes 2022-09-01 19:21:27 -04:00
hyperv ARM: 2022-08-04 14:59:54 -07:00
ia32 x86: Remove a.out support 2022-04-11 18:04:27 +02:00
include - Add the respective UP last level cache mask accessors in order not to 2022-10-02 09:30:35 -07:00
kernel - Add the respective UP last level cache mask accessors in order not to 2022-10-02 09:30:35 -07:00
kvm KVM: nVMX: Unconditionally purge queued/injected events on nested "exit" 2022-10-21 12:37:54 +02:00
lib x86/uaccess: avoid check_object_size() in copy_from_user_nmi() 2022-09-26 12:14:35 -07:00
math-emu x86/32: Remove lazy GS macros 2022-04-14 14:09:43 +02:00
mm x86/mm: disable instrumentations of mm/pgprot.c 2022-09-11 16:22:30 -07:00
net Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2022-07-22 16:55:44 -07:00
pci x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions" 2022-06-17 14:24:14 -05:00
platform Bitmap patches for v6.0-rc1 2022-08-07 17:52:35 -07:00
power x86/cpu: Load microcode during restore_processor_state() 2022-04-19 19:37:05 +02:00
purgatory x86/purgatory: Omit use of bin2c 2022-07-25 10:32:32 +02:00
ras
realmode Intel Trust Domain Extensions 2022-05-23 17:51:12 -07:00
tools
um arch: um: Mark the stack non-executable to fix a binutils warning 2022-09-21 09:11:42 +02:00
video
virt/vmx/tdx x86/tdx: Provide common base for SEAMCALL and TDCALL C wrappers 2022-04-07 08:27:50 -07:00
xen x86/xen: Add support for HVMOP_set_evtchn_upcall_vector 2022-08-12 11:28:21 +02:00
.gitignore x86/purgatory: Omit use of bin2c 2022-07-25 10:32:32 +02:00
Kbuild
Kconfig - The usual batches of cleanups from Baoquan He, Muchun Song, Miaohe 2022-08-05 16:32:45 -07:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-06-23 15:39:21 +01:00
Makefile asm goto: eradicate CC_HAS_ASM_GOTO 2022-08-21 10:06:28 -07:00
Makefile.um
Makefile_32.cpu