KVM: Fix KVM_GET_MSR_INDEX_LIST
authorJan Kiszka <jan.kiszka@web.de>
Thu, 2 Jul 2009 19:45:47 +0000 (21:45 +0200)
committerAvi Kivity <avi@redhat.com>
Wed, 5 Aug 2009 10:58:03 +0000 (13:58 +0300)
commite125e7b6944898831b56739a5448e705578bf7e2
tree27bdf220e2bedfd20358627563509089e8584003
parent90bc1a658a53f8832ee799685703977a450e5af9
KVM: Fix KVM_GET_MSR_INDEX_LIST

So far, KVM copied the emulated_msrs (only MSR_IA32_MISC_ENABLE) to a
wrong address in user space due to broken pointer arithmetic. This
caused subtle corruption up there (missing MSR_IA32_MISC_ENABLE had
probably no practical relevance). Moreover, the size check for the
user-provided kvm_msr_list forgot about emulated MSRs.

Cc: stable@kernel.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/x86.c