[linux] 01/02: [x86] KVM: Intercept #AC to avoid guest->host denial-of-service (CVE-2015-5307)

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Tue Nov 10 10:36:29 UTC 2015


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch wheezy-security
in repository linux.

commit 794834ec660ce9d596cdcf73a0c08ff34258dae5
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Sun Nov 8 13:13:20 2015 +0000

    [x86] KVM: Intercept #AC to avoid guest->host denial-of-service (CVE-2015-5307)
---
 debian/changelog                                   |  2 +
 ...-intercept-ac-to-avoid-guest-host-exploit.patch | 38 +++++++++++++++++++
 ...x-avoid-guest-host-dos-by-intercepting-ac.patch | 44 ++++++++++++++++++++++
 debian/patches/series                              |  2 +
 4 files changed, 86 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index eaf51de..cc59f1d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ linux (3.2.68-1+deb7u6) UNRELEASED; urgency=medium
   * usbvision: fix overflow of interfaces array (CVE-2015-7833)
   * RDS: fix race condition when sending a message on unbound socket
     (CVE-2015-7990)
+  * [x86] KVM: Intercept #AC to avoid guest->host denial-of-service
+    (CVE-2015-5307)
 
  -- Salvatore Bonaccorso <carnil at debian.org>  Wed, 21 Oct 2015 17:00:31 +0200
 
diff --git a/debian/patches/bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch b/debian/patches/bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch
new file mode 100644
index 0000000..bb7ecb7
--- /dev/null
+++ b/debian/patches/bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch
@@ -0,0 +1,38 @@
+Subject: KVM x86 SVM: intercept #AC to avoid guest->host exploit
+
+---
+M arch/x86/kvm/svm.c
+1 file changed, 8 insertions(+), 0 deletions(-)
+
+
+--- a/arch/x86/kvm/svm.c
++++ b/arch/x86/kvm/svm.c
+@@ -1014,6 +1014,7 @@ static void init_vmcb(struct vcpu_svm *s
+ 	set_exception_intercept(svm, PF_VECTOR);
+ 	set_exception_intercept(svm, UD_VECTOR);
+ 	set_exception_intercept(svm, MC_VECTOR);
++	set_exception_intercept(svm, AC_VECTOR);
+ 
+ 	set_intercept(svm, INTERCEPT_INTR);
+ 	set_intercept(svm, INTERCEPT_NMI);
+@@ -1689,6 +1690,12 @@ static int ud_interception(struct vcpu_s
+ 	return 1;
+ }
+ 
++static int ac_interception(struct vcpu_svm *svm)
++{
++	kvm_queue_exception_e(&svm->vcpu, AC_VECTOR, 0);
++	return 1;
++}
++
+ static void svm_fpu_activate(struct kvm_vcpu *vcpu)
+ {
+ 	struct vcpu_svm *svm = to_svm(vcpu);
+@@ -3188,6 +3195,7 @@ static int (*svm_exit_handlers[])(struct
+ 	[SVM_EXIT_EXCP_BASE + PF_VECTOR]	= pf_interception,
+ 	[SVM_EXIT_EXCP_BASE + NM_VECTOR]	= nm_interception,
+ 	[SVM_EXIT_EXCP_BASE + MC_VECTOR]	= mc_interception,
++	[SVM_EXIT_EXCP_BASE + AC_VECTOR]	= ac_interception,
+ 	[SVM_EXIT_INTR]				= intr_interception,
+ 	[SVM_EXIT_NMI]				= nmi_interception,
+ 	[SVM_EXIT_SMI]				= nop_on_interception,
diff --git a/debian/patches/bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch b/debian/patches/bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch
new file mode 100644
index 0000000..d60fd13
--- /dev/null
+++ b/debian/patches/bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch
@@ -0,0 +1,44 @@
+From: Eric Northup <digitaleric at google.com>
+Date: Thu Sep 10 11:36:28 2015 -0700
+Subject: KVM x86 vmx: avoid guest->host DOS by intercepting #AC
+
+A pathological (or malicious) guest can hang a host core by
+mis-configuring its GDT/IDT and enabling alignment checks.
+
+[bwh: Backported to 3.2: adjust filename]
+
+--- a/arch/x86/include/asm/kvm_host.h
++++ b/arch/x86/include/asm/kvm_host.h
+@@ -83,6 +83,7 @@
+ #define GP_VECTOR 13
+ #define PF_VECTOR 14
+ #define MF_VECTOR 16
++#define AC_VECTOR 17
+ #define MC_VECTOR 18
+ 
+ #define SELECTOR_TI_MASK (1 << 2)
+--- a/arch/x86/kvm/vmx.c
++++ b/arch/x86/kvm/vmx.c
+@@ -1171,7 +1171,7 @@ static void update_exception_bitmap(stru
+ 	u32 eb;
+ 
+ 	eb = (1u << PF_VECTOR) | (1u << UD_VECTOR) | (1u << MC_VECTOR) |
+-	     (1u << NM_VECTOR) | (1u << DB_VECTOR);
++	     (1u << NM_VECTOR) | (1u << DB_VECTOR) | (1u << AC_VECTOR);
+ 	if ((vcpu->guest_debug &
+ 	     (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP)) ==
+ 	    (KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP))
+@@ -4286,6 +4286,13 @@ static int handle_exception(struct kvm_v
+ 		kvm_run->debug.arch.pc = vmcs_readl(GUEST_CS_BASE) + rip;
+ 		kvm_run->debug.arch.exception = ex_no;
+ 		break;
++	case AC_VECTOR:
++		/*
++		 * We have already enabled interrupts and pre-emption, so
++		 * it's OK to loop here if that is what will happen.
++		 */
++		kvm_queue_exception_e(vcpu, AC_VECTOR, error_code);
++		return 1;
+ 	default:
+ 		kvm_run->exit_reason = KVM_EXIT_EXCEPTION;
+ 		kvm_run->ex.exception = ex_no;
diff --git a/debian/patches/series b/debian/patches/series
index a466d36..06065f3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1189,3 +1189,5 @@ bugfix/all/KEYS-Fix-crash-when-attempt-to-garbage-collect-an-un.patch
 bugfix/all/KEYS-Don-t-permit-request_key-to-construct-a-new-key.patch
 bugfix/all/usbvision-fix-overflow-of-interfaces-array.patch
 bugfix/all/rds-fix-race-condition-when-sending-a-message-on-unbound-socket.patch
+bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch
+bugfix/x86/kvm-x86-svm-intercept-ac-to-avoid-guest-host-exploit.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list