linux-stable/arch/x86/kvm
Zhenzhong Duan 5c49d1850d KVM: VMX: Fix a TSX_CTRL_CPUID_CLEAR field mask issue
When updating the host's mask for its MSR_IA32_TSX_CTRL user return entry,
clear the mask in the found uret MSR instead of vmx->guest_uret_msrs[i].
Modifying guest_uret_msrs directly is completely broken as 'i' does not
point at the MSR_IA32_TSX_CTRL entry.  In fact, it's guaranteed to be an
out-of-bounds accesses as is always set to kvm_nr_uret_msrs in a prior
loop. By sheer dumb luck, the fallout is limited to "only" failing to
preserve the host's TSX_CTRL_CPUID_CLEAR.  The out-of-bounds access is
benign as it's guaranteed to clear a bit in a guest MSR value, which are
always zero at vCPU creation on both x86-64 and i386.

Cc: stable@vger.kernel.org
Fixes: 8ea8b8d6f8 ("KVM: VMX: Use common x86's uret MSR list as the one true list")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210926015545.281083-1-zhenzhong.duan@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-27 11:25:40 -04:00
..
mmu KVM: X86: Synchronize the shadow pagetable before link it 2021-09-23 11:01:00 -04:00
svm KVM: x86: nSVM: don't copy virt_ext from vmcb12 2021-09-23 10:06:46 -04:00
vmx KVM: VMX: Fix a TSX_CTRL_CPUID_CLEAR field mask issue 2021-09-27 11:25:40 -04:00
cpuid.c KVM: x86: Allow guest to set EFER.NX=1 on non-PAE 32-bit kernels 2021-08-13 03:20:17 -04:00
cpuid.h KVM: x86: Move reverse CPUID helpers to separate header file 2021-04-26 05:27:13 -04:00
debugfs.c KVM: X86: Introduce mmu_rmaps_stat per-vm debugfs file 2021-08-20 16:06:11 -04:00
emulate.c kvm: fix wrong exception emulation in check_rdtsc 2021-09-22 10:33:11 -04:00
fpu.h KVM: x86: Move FPU register accessors into fpu.h 2021-06-17 13:09:24 -04:00
hyperv.c KVM: x86: Query vcpu->vcpu_idx directly and drop its accessor 2021-09-22 10:33:11 -04:00
hyperv.h KVM: x86: Query vcpu->vcpu_idx directly and drop its accessor 2021-09-22 10:33:11 -04:00
i8254.c KVM: x86: Migrate the PIT only if vcpu0 is migrated, not any BSP 2021-08-02 11:01:51 -04:00
i8254.h
i8259.c x86: Fix typo s/ECLR/ELCR/ for the PIC register 2021-08-10 23:31:44 +02:00
ioapic.c KVM: x86: Fix stack-out-of-bounds memory access from ioapic_write_indirect() 2021-09-22 10:33:14 -04:00
ioapic.h x86/kvm: remove non-x86 stuff from arch/x86/kvm/ioapic.h 2021-08-02 11:01:46 -04:00
irq.c KVM: x86/xen: Add event channel interrupt vector upcall 2021-02-04 14:19:39 +00:00
irq.h x86: Fix typo s/ECLR/ELCR/ for the PIC register 2021-08-10 23:31:44 +02:00
irq_comm.c x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
Kconfig ARM: 2021-06-28 15:40:51 -07:00
kvm_cache_regs.h KVM: x86: Introduce KVM_GET_SREGS2 / KVM_SET_SREGS2 2021-06-17 13:09:47 -04:00
kvm_emulate.h KVM: x86: Drop "pre_" from enter/leave_smm() helpers 2021-06-17 13:09:35 -04:00
kvm_onhyperv.c KVM: x86: hyper-v: Move the remote TLB flush logic out of vmx 2021-06-17 13:09:36 -04:00
kvm_onhyperv.h KVM: x86: hyper-v: Move the remote TLB flush logic out of vmx 2021-06-17 13:09:36 -04:00
lapic.c KVM: x86: Consolidate APIC base RESET initialization code 2021-08-02 11:01:52 -04:00
lapic.h KVM: x86: Add a return code to kvm_apic_accept_events 2021-06-17 13:09:31 -04:00
Makefile KVM: stats: Add fd-based API to read binary stats data 2021-06-24 11:47:57 -04:00
mmu.h KVM: x86/mmu: Add detailed page size stats 2021-08-20 16:06:34 -04:00
mtrr.c KVM: x86: Add helper to consolidate "raw" reserved GPA mask calculations 2021-02-04 09:27:30 -05:00
pmu.c KVM: x86/pmu: Introduce pmc->is_paused to reduce the call time of perf interfaces 2021-08-04 05:55:56 -04:00
pmu.h KVM: x86/pmu: Introduce pmc->is_paused to reduce the call time of perf interfaces 2021-08-04 05:55:56 -04:00
reverse_cpuid.h KVM: SEV: Mask CPUID[0x8000001F].eax according to supported features 2021-04-26 05:27:15 -04:00
trace.h KVM: x86: Introduce trace_kvm_hv_hypercall_done() 2021-08-03 06:16:40 -04:00
tss.h
x86.c kvm: x86: Add AMD PMU MSRs to msrs_to_save_all[] 2021-09-22 11:30:14 -04:00
x86.h KVM: x86: Move declaration of kvm_spurious_fault() to x86.h 2021-08-13 03:35:16 -04:00
xen.c KVM: xen: do not use struct gfn_to_hva_cache 2021-08-05 03:31:40 -04:00
xen.h KVM: xen: do not use struct gfn_to_hva_cache 2021-08-05 03:31:40 -04:00