[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:59 UTC 2015
This is an automated email from the git hooks/post-receive script.
benh pushed a commit to branch jessie-security
in repository linux.
commit fc0fb27d02d6d73406264024a35829c145276bb4
Author: Ben Hutchings <ben at decadent.org.uk>
Date: Sun Nov 8 13:16:54 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 | 42 ++++++++++++++++++++++
debian/patches/series | 2 ++
4 files changed, 84 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 6ef0a6e..2ecfe56 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ linux (3.16.7-ckt11-1+deb8u6) 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> Tue, 20 Oct 2015 19:12:50 +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..ed5ae71
--- /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
+@@ -1101,6 +1101,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);
+@@ -1785,6 +1786,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);
+@@ -3325,6 +3332,7 @@ static int (*const svm_exit_handlers[])(
+ [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..ef70a29
--- /dev/null
+++ b/debian/patches/bugfix/x86/kvm-x86-vmx-avoid-guest-host-dos-by-intercepting-ac.patch
@@ -0,0 +1,42 @@
+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.
+
+--- a/arch/x86/include/uapi/asm/kvm.h
++++ b/arch/x86/include/uapi/asm/kvm.h
+@@ -23,6 +23,7 @@
+ #define GP_VECTOR 13
+ #define PF_VECTOR 14
+ #define MF_VECTOR 16
++#define AC_VECTOR 17
+ #define MC_VECTOR 18
+
+ /* Select x86 specific features in <linux/kvm.h> */
+--- a/arch/x86/kvm/vmx.c
++++ b/arch/x86/kvm/vmx.c
+@@ -1467,7 +1467,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))
+@@ -4908,6 +4908,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 c4b3948..221f89c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -657,3 +657,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