linux-stable/arch/x86
Sean Christopherson 8e61c799c8 KVM: nVMX: Query current VMCS when determining if MSR bitmaps are in use
commit 7dfbc624eb upstream.

Check the current VMCS controls to determine if an MSR write will be
intercepted due to MSR bitmaps being disabled.  In the nested VMX case,
KVM will disable MSR bitmaps in vmcs02 if they're disabled in vmcs12 or
if KVM can't map L1's bitmaps for whatever reason.

Note, the bad behavior is relatively benign in the current code base as
KVM sets all bits in vmcs02's MSR bitmap by default, clears bits if and
only if L0 KVM also disables interception of an MSR, and only uses the
buggy helper for MSR_IA32_SPEC_CTRL.  Because KVM explicitly tests WRMSR
before disabling interception of MSR_IA32_SPEC_CTRL, the flawed check
will only result in KVM reading MSR_IA32_SPEC_CTRL from hardware when it
isn't strictly necessary.

Tag the fix for stable in case a future fix wants to use
msr_write_intercepted(), in which case a buggy implementation in older
kernels could prove subtly problematic.

Fixes: d28b387fb7 ("KVM/VMX: Allow direct access to MSR_IA32_SPEC_CTRL")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211109013047.2041518-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-11-17 09:48:24 +01:00
..
boot x86/boot: Add .text.* to setup.ld 2021-06-16 11:59:38 +02:00
configs
crypto
entry
events perf/x86: Reset destroy callback on event init failure 2021-10-09 14:39:50 +02:00
hyperv
ia32
include x86/kvmclock: Move this_cpu_pvti into kvmclock.h 2021-10-06 15:42:31 +02:00
kernel x86/irq: Ensure PI wakeup handler is unregistered before module unload 2021-11-17 09:48:19 +01:00
kvm KVM: nVMX: Query current VMCS when determining if MSR bitmaps are in use 2021-11-17 09:48:24 +01:00
lib
math-emu
mm x86/sme: Use #define USE_EARLY_PGTABLE_L5 in mem_encrypt_identity.c 2021-11-17 09:48:19 +01:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
oprofile
pci PCI: Add AMD RS690 quirk to enable 64-bit DMA 2021-06-30 08:47:49 -04:00
platform x86/platform/olpc: Correct ifdef symbol to intended CONFIG_OLPC_XO15_SCI 2021-10-13 10:08:20 +02:00
power
purgatory
ras
realmode
tools x86/tools: Fix objdump version check again 2021-08-18 08:57:01 +02:00
um
video
xen xen/x86: fix PV trap handling on secondary processors 2021-09-30 10:09:21 +02:00
.gitignore
Kbuild
Kconfig x86/Kconfig: Do not enable AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT automatically 2021-10-20 11:40:15 +02:00
Kconfig.cpu
Kconfig.debug
Makefile
Makefile.um
Makefile_32.cpu