From 26bf44d25b673d7e0e441113459e227c53b56938 Mon Sep 17 00:00:00 2001 From: Andrew Honig Date: Wed, 3 Jan 2018 13:08:23 -0500 Subject: [PATCH] KVM: VMX: remove I/O port 0x80 bypass on Intel hosts This fixes CVE-2017-1000407. KVM allows guests to directly access I/O port 0x80 on Intel hosts. If the guest floods this port with writes it generates exceptions and instability in the host kernel, leading to a crash. With this change guest writes to port 0x80 on Intel will behave the same as they currently behave on AMD systems. Prevent the flooding by removing the code that sets port 0x80 as a passthrough port. This is essentially the same as upstream patch 99f85a28a78e96d28907fe036e1671a218fee597, except that patch was for AMD chipsets and this patch is for Intel. Signed-off-by: Andrew Honig Signed-off-by: Jim Mattson (cherry picked from commit d59d51f088014f25c2562de59b9abff4f42a7468) Orabug: 27206805 CVE: CVE-2017-1000407 Signed-off-by: Krish Sadhukhan Acked-by: Liran Alon Reviewed-by: Boris Ostrovsky Signed-off-by: Konrad Rzeszutek Wilk --- arch/x86/kvm/vmx.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 3d6da9efdda7..f0c9ff45fd66 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -6084,12 +6084,7 @@ static __init int hardware_setup(void) memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE); memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE); - /* - * Allow direct access to the PC debug port (it is often used for I/O - * delays, but the vmexits simply slow things down). - */ memset(vmx_io_bitmap_a, 0xff, PAGE_SIZE); - clear_bit(0x80, vmx_io_bitmap_a); memset(vmx_io_bitmap_b, 0xff, PAGE_SIZE); -- 2.50.1