linux-stable/arch
Marcelo Tosatti 59839dfff5 KVM: x86: check for cr3 validity in ioctl_set_sregs
Matt T. Yourst notes that kvm_arch_vcpu_ioctl_set_sregs lacks validity
checking for the new cr3 value:

"Userspace callers of KVM_SET_SREGS can pass a bogus value of cr3 to
the kernel. This will trigger a NULL pointer access in gfn_to_rmap()
when userspace next tries to call KVM_RUN on the affected VCPU and kvm
attempts to activate the new non-existent page table root.

This happens since kvm only validates that cr3 points to a valid guest
physical memory page when code *inside* the guest sets cr3. However, kvm
currently trusts the userspace caller (e.g. QEMU) on the host machine to
always supply a valid page table root, rather than properly validating
it along with the rest of the reloaded guest state."

http://sourceforge.net/tracker/?func=detail&atid=893831&aid=2687641&group_id=180599

Check for a valid cr3 address in kvm_arch_vcpu_ioctl_set_sregs, triple
fault in case of failure.

Cc: stable@kernel.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2009-06-10 11:48:43 +03:00
..
alpha alpha: unbreak percpu again 2009-05-12 14:11:35 -07:00
arm Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 2009-06-04 17:02:58 +01:00
avr32 avr32: drop unused CLEAN_FILES 2009-05-01 10:54:00 +02:00
blackfin flat: fix data sections alignment 2009-05-29 08:40:02 -07:00
cris CRISv32: Fix typo compile error in ARTPEC-3 gpio driver. 2009-04-28 19:08:10 +02:00
frv FRV: Use __INIT macro instead of .text.init. 2009-04-27 19:46:30 -07:00
h8300 flat: fix data sections alignment 2009-05-29 08:40:02 -07:00
ia64 KVM: ia64: Don't hold slots_lock in guest mode 2009-06-10 11:48:43 +03:00
m32r flat: fix data sections alignment 2009-05-29 08:40:02 -07:00
m68k flat: fix data sections alignment 2009-05-29 08:40:02 -07:00
m68knommu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2009-04-24 08:45:53 -07:00
microblaze microblaze: Fix kind-of-intr checking against number of interrupts 2009-05-18 14:47:42 +02:00
mips MIPS: Outline udelay and fix a few issues. 2009-06-08 16:57:51 +01:00
mn10300 mn10300: convert to use __HEAD and HEAD_TEXT macros. 2009-04-26 09:20:38 -07:00
parisc Merge git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6 2009-04-03 09:52:04 -07:00
powerpc KVM: Fix interrupt unhalting a vcpu when it shouldn't 2009-06-10 11:48:33 +03:00
s390 KVM: Fix interrupt unhalting a vcpu when it shouldn't 2009-06-10 11:48:33 +03:00
sh flat: fix data sections alignment 2009-05-29 08:40:02 -07:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2009-06-01 08:02:31 -07:00
um uml: kill a kconfig warning 2009-04-21 13:41:50 -07:00
x86 KVM: x86: check for cr3 validity in ioctl_set_sregs 2009-06-10 11:48:43 +03:00
xtensa xtensa: Fix linker script to include .literal sections 2009-05-11 23:40:33 -07:00
.gitignore
Kconfig mutex: have non-spinning mutexes on s390 by default 2009-04-09 19:28:24 +02:00