linux/arch/x86/kvm/vmx
Sean Christopherson 053d2290c0 KVM: VMX: Exit to userspace if vCPU has injected exception and invalid state
Exit to userspace with an emulation error if KVM encounters an injected
exception with invalid guest state, in addition to the existing check of
bailing if there's a pending exception (KVM doesn't support emulating
exceptions except when emulating real mode via vm86).

In theory, KVM should never get to such a situation as KVM is supposed to
exit to userspace before injecting an exception with invalid guest state.
But in practice, userspace can intervene and manually inject an exception
and/or stuff registers to force invalid guest state while a previously
injected exception is awaiting reinjection.

Fixes: fc4fad79fc ("KVM: VMX: Reject KVM_RUN if emulation is required with pending exception")
Reported-by: syzbot+cfafed3bb76d3e37581b@syzkaller.appspotmail.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220502221850.131873-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-06 13:08:06 -04:00
..
capabilities.h KVM: VMX: Remove vmcs_config.order 2022-01-26 12:14:58 -05:00
evmcs.c KVM: nVMX: Implement evmcs_field_offset() suitable for handle_vmread() 2022-01-28 07:38:26 -05:00
evmcs.h KVM: nVMX: Allow VMREAD when Enlightened VMCS is in use 2022-01-28 07:38:26 -05:00
nested.c KVM: nVMX: Defer APICv updates while L2 is active until L1 is active 2022-04-21 13:16:12 -04:00
nested.h KVM: nVMX: Refactor PMU refresh to avoid referencing kvm_x86_ops.pmu_ops 2022-02-10 13:47:19 -05:00
pmu_intel.c KVM: x86/pmu: Update AMD PMC sample period to fix guest NMI-watchdog 2022-04-21 13:16:14 -04:00
posted_intr.c KVM: VMX: Rename VMX functions to conform to kvm_x86_ops names 2022-02-10 13:47:20 -05:00
posted_intr.h KVM: VMX: Rename VMX functions to conform to kvm_x86_ops names 2022-02-10 13:47:20 -05:00
sgx.c KVM: x86: SGX must obey the KVM_INTERNAL_ERROR_EMULATION protocol 2021-10-25 06:48:25 -04:00
sgx.h KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC 2021-04-20 04:18:56 -04:00
vmcs12.c KVM: nVMX: Rename vmcs_to_field_offset{,_table} 2022-01-28 07:38:26 -05:00
vmcs12.h KVM: nVMX: Rename vmcs_to_field_offset{,_table} 2022-01-28 07:38:26 -05:00
vmcs_shadow_fields.h
vmcs.h kvm: x86: Intercept #NM for saving IA32_XFD_ERR 2022-01-14 13:44:18 -05:00
vmenter.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00
vmx_ops.h RISCV: 2022-01-16 16:15:14 +02:00
vmx.c KVM: VMX: Exit to userspace if vCPU has injected exception and invalid state 2022-05-06 13:08:06 -04:00
vmx.h KVM: nVMX: Defer APICv updates while L2 is active until L1 is active 2022-04-21 13:16:12 -04:00