[SRU Trusty 2/2] UBUNTU: SAUCE: KVM: Fix spec_ctrl CPUID support for guests

Stefan Bader stefan.bader at canonical.com
Wed Jan 17 14:31:29 UTC 2018


CVE-2017-5753
CVE-2017-5715

The ordering of the internal enum in scatter.c is eax=0, exc, edx, ebx,
so CR_EDX is 2.

Fixes: 07dce5b  ("UBUNTU: SAUCE: KVM: x86: Add speculative control CPUID
support for guests")
Signed-off-by: Stefan Bader <stefan.bader at canonical.com>
---
 arch/x86/kvm/cpuid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index c400546..ceb0535 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -396,7 +396,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 			// TSC_ADJUST is emulated
 			entry->ebx |= F(TSC_ADJUST);
 			entry->edx &= kvm_cpuid_7_0_edx_x86_features;
-			entry->edx &= get_scattered_cpuid_leaf(7, 0, 3);
+			/* CR_EDX == 2 */
+			entry->edx &= get_scattered_cpuid_leaf(7, 0, 2);
 		} else {
 			entry->ebx = 0;
 			entry->edx = 0;
-- 
2.7.4





More information about the kernel-team mailing list