rpms/kernel/F-11 linux-2.6-kvm-revert-x86-check-for-cr3-validity.patch, NONE, 1.1 kernel.spec, 1.1747, 1.1748

Chuck Ebbert cebbert at fedoraproject.org
Mon Sep 28 16:54:12 UTC 2009


Author: cebbert

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

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-kvm-revert-x86-check-for-cr3-validity.patch 
Log Message:
Add linux-2.6-kvm-revert-x86-check-for-cr3-validity.patch, from
  2.6.32-rc, fixes bug #525743

linux-2.6-kvm-revert-x86-check-for-cr3-validity.patch:
 x86.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

--- NEW FILE linux-2.6-kvm-revert-x86-check-for-cr3-validity.patch ---
From: Jan Kiszka <jan.kiszka at web.de>
Date: Wed, 1 Jul 2009 18:52:03 +0000 (+0200)
Subject: Revert "KVM: x86: check for cr3 validity in ioctl_set_sregs"
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=dc7e795e3dd2a763e5ceaa1615f307e808cf3932

Revert "KVM: x86: check for cr3 validity in ioctl_set_sregs"

This reverts commit 6c20e1442bb1c62914bb85b7f4a38973d2a423ba.

To my understanding, it became obsolete with the advent of the more
robust check in mmu_alloc_roots (89da4ff17f). Moreover, it prevents
the conceptually safe pattern

 1. set sregs
 2. register mem-slots
 3. run vcpu

by setting a sticky triple fault during step 1.

Signed-off-by: Jan Kiszka <jan.kiszka at siemens.com>
Signed-off-by: Avi Kivity <avi at redhat.com>
---

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6dde99c..0e74d98 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4326,13 +4326,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
 
 	vcpu->arch.cr2 = sregs->cr2;
 	mmu_reset_needed |= vcpu->arch.cr3 != sregs->cr3;
-
-	down_read(&vcpu->kvm->slots_lock);
-	if (gfn_to_memslot(vcpu->kvm, sregs->cr3 >> PAGE_SHIFT))
-		vcpu->arch.cr3 = sregs->cr3;
-	else
-		set_bit(KVM_REQ_TRIPLE_FAULT, &vcpu->requests);
-	up_read(&vcpu->kvm->slots_lock);
+	vcpu->arch.cr3 = sregs->cr3;
 
 	kvm_set_cr8(vcpu, sregs->cr8);
 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1747
retrieving revision 1.1748
diff -u -p -r1.1747 -r1.1748
--- kernel.spec	28 Sep 2009 16:48:31 -0000	1.1747
+++ kernel.spec	28 Sep 2009 16:54:12 -0000	1.1748
@@ -765,6 +765,9 @@ Patch14402: kvm-vmx-check-cpl-before-emu
 Patch14403: kvm-vmx-fix-cr8-exiting-control-clobbering-by-ept.patch
 Patch14404: kvm-x86-disallow-hypercalls-for-guest-callers-in-rings-0.patch
 
+# fixes bug #525743, send for -stable
+Patch14410: linux-2.6-kvm-revert-x86-check-for-cr3-validity.patch
+
 # appletalk: fix skb leak (CVE-2009-2903)
 Patch15200: appletalk-fix-skb-leak-when-ipddp-interface-is-not-loaded.patch
 
@@ -1429,6 +1432,9 @@ ApplyPatch kvm-vmx-check-cpl-before-emul
 ApplyPatch kvm-vmx-fix-cr8-exiting-control-clobbering-by-ept.patch
 ApplyPatch kvm-x86-disallow-hypercalls-for-guest-callers-in-rings-0.patch
 
+# fixes bug #525743, send for -stable
+ApplyPatch linux-2.6-kvm-revert-x86-check-for-cr3-validity.patch
+
 # appletalk: fix skb leak (CVE-2009-2903)
 ApplyPatch appletalk-fix-skb-leak-when-ipddp-interface-is-not-loaded.patch
 
@@ -2020,6 +2026,10 @@ fi
 # and build.
 
 %changelog
+* Mon Sep 28 2009  Chuck Ebbert <cebbert at redhat.com>  2.6.30.8-69
+- Add linux-2.6-kvm-revert-x86-check-for-cr3-validity.patch, from
+  2.6.32-rc, fixes bug #525743
+
 * Mon Sep 28 2009  Chuck Ebbert <cebbert at redhat.com>  2.6.30.8-68
 - Drop sched-disable-NEW-FAIR-SLEEPERS-for-now.patch, reported to
   cause problems on 2.6.30.




More information about the fedora-extras-commits mailing list