rpms/kernel/F-11 kvm-prevent-overflow-in-kvm-get-supported-cpuid.patch, NONE, 1.1 kernel.spec, 1.1772, 1.1773

Chuck Ebbert cebbert at fedoraproject.org
Fri Oct 23 13:41:38 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17208

Modified Files:
	kernel.spec 
Added Files:
	kvm-prevent-overflow-in-kvm-get-supported-cpuid.patch 
Log Message:
Fix overflow in KVM cpuid code.

kvm-prevent-overflow-in-kvm-get-supported-cpuid.patch:
 x86.c |    2 ++
 1 file changed, 2 insertions(+)

--- NEW FILE kvm-prevent-overflow-in-kvm-get-supported-cpuid.patch ---
From: Avi Kivity <avi at redhat.com>
Date: Sun, 4 Oct 2009 14:45:13 +0000 (+0200)
Subject: KVM: Prevent overflow in KVM_GET_SUPPORTED_CPUID
X-Git-Tag: v2.6.32-rc4~55^2~3
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=6a54435560efdab1a08f429a954df4d6c740bddf

KVM: Prevent overflow in KVM_GET_SUPPORTED_CPUID

The number of entries is multiplied by the entry size, which can
overflow on 32-bit hosts.  Bound the entry count instead.

Reported-by: David Wagner <daw at cs.berkeley.edu>
Cc: stable at kernel.org
Signed-off-by: Avi Kivity <avi at redhat.com>
---

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index be451ee..9b96953 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1591,6 +1591,8 @@ static int kvm_dev_ioctl_get_supported_cpuid(struct kvm_cpuid2 *cpuid,
 
 	if (cpuid->nent < 1)
 		goto out;
+	if (cpuid->nent > KVM_MAX_CPUID_ENTRIES)
+		cpuid->nent = KVM_MAX_CPUID_ENTRIES;
 	r = -ENOMEM;
 	cpuid_entries = vmalloc(sizeof(struct kvm_cpuid_entry2) * cpuid->nent);
 	if (!cpuid_entries)


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1772
retrieving revision 1.1773
diff -u -p -r1.1772 -r1.1773
--- kernel.spec	22 Oct 2009 20:54:21 -0000	1.1772
+++ kernel.spec	23 Oct 2009 13:41:37 -0000	1.1773
@@ -822,6 +822,9 @@ Patch16401: af_unix-fix-deadlock-connect
 # Fix exploitable oops in keyring code
 Patch16420: keys-get_instantiation_keyring-should-inc-the-keyring-refcount.patch
 
+# Fix overflow in KVM cpuid code
+Patch16430: kvm-prevent-overflow-in-kvm-get-supported-cpuid.patch
+
 %endif
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1542,6 +1545,9 @@ ApplyPatch af_unix-fix-deadlock-connecti
 # Fix exploitable oops in keyring code.
 ApplyPatch keys-get_instantiation_keyring-should-inc-the-keyring-refcount.patch
 
+# Fix overflow in KVM cpuid code
+ApplyPatch kvm-prevent-overflow-in-kvm-get-supported-cpuid.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2130,8 +2136,11 @@ fi
 # and build.
 
 %changelog
+* Thu Oct 22 2009 Chuck Ebbert <cebbert at redhat.com>  2.6.30.9-94
+- Fix overflow in KVM cpuid code.
+
 * Thu Oct 22 2009 Chuck Ebbert <cebbert at redhat.com>  2.6.30.9-93
-- Fix exploitable oops in keyring code.
+- Fix exploitable oops in keyring code (CVE-2009-3624)
 
 * Wed Oct 21 2009 Kyle McMartin <kyle at redhat.com>
 - shut-up-LOCK_TEST_WITH_RETURN.patch: sort out #445331... or paper bag




More information about the fedora-extras-commits mailing list