Skip to content

Commit c71227e

Browse files
committed
Merge: CVE-2024-53135: KVM: VMX: Bury Intel PT virtualization (guest/host mode) behind CONFIG_BROKEN
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5946 JIRA: https://issues.redhat.com/browse/RHEL-70062 CVE: CVE-2024-53135 ``` KVM: VMX: Bury Intel PT virtualization (guest/host mode) behind CONFIG_BROKEN Hide KVM's pt_mode module param behind CONFIG_BROKEN, i.e. disable support for virtualizing Intel PT via guest/host mode unless BROKEN=y. There are myriad bugs in the implementation, some of which are fatal to the guest, and others which put the stability and health of the host at risk. For guest fatalities, the most glaring issue is that KVM fails to ensure tracing is disabled, and *stays* disabled prior to VM-Enter, which is necessary as hardware disallows loading (the guest's) RTIT_CTL if tracing is enabled (enforced via a VMX consistency check). Per the SDM: If the logical processor is operating with Intel PT enabled (if IA32_RTIT_CTL.TraceEn = 1) at the time of VM entry, the "load IA32_RTIT_CTL" VM-entry control must be 0. On the host side, KVM doesn't validate the guest CPUID configuration provided by userspace, and even worse, uses the guest configuration to decide what MSRs to save/load at VM-Enter and VM-Exit. E.g. configuring guest CPUID to enumerate more address ranges than are supported in hardware will result in KVM trying to passthrough, save, and load non-existent MSRs, which generates a variety of WARNs, ToPA ERRORs in the host, a potential deadlock, etc. Fixes: f99e3da ("KVM: x86: Add Intel PT virtualization work mode") Cc: [email protected] Cc: Adrian Hunter <[email protected]> Signed-off-by: Sean Christopherson <[email protected]> Reviewed-by: Xiaoyao Li <[email protected]> Tested-by: Adrian Hunter <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]> (cherry picked from commit aa0d42c) ``` Signed-off-by: CKI Backport Bot <[email protected]> Signed-off-by: Jarod Wilson <[email protected]> --- <small>Created 2024-12-05 04:49 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://gitlab.com/cki-project/kernel-workflow/-/issues/new?issue%5Btitle%5D=backporter%20webhook%20issue)</small> Approved-by: Jon Maloy <[email protected]> Approved-by: Vitaly Kuznetsov <[email protected]> Approved-by: David Arcari <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Jan Stancek <[email protected]>
2 parents 303ce56 + ced8450 commit c71227e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ module_param(ple_window_shrink, uint, 0444);
215215
static unsigned int ple_window_max = KVM_VMX_DEFAULT_PLE_WINDOW_MAX;
216216
module_param(ple_window_max, uint, 0444);
217217

218-
/* Default is SYSTEM mode, 1 for host-guest mode */
218+
/* Default is SYSTEM mode, 1 for host-guest mode (which is BROKEN) */
219219
int __read_mostly pt_mode = PT_MODE_SYSTEM;
220+
#ifdef CONFIG_BROKEN
220221
module_param(pt_mode, int, S_IRUGO);
222+
#endif
221223

222224
struct x86_pmu_lbr __ro_after_init vmx_lbr_caps;
223225

0 commit comments

Comments
 (0)