KVM: Fix KVM_GET_MSR_INDEX_LIST
commit378392b260dbe265401948d5d5b77fe6d537501c
authorJan Kiszka <jan.kiszka@web.de>
Thu, 2 Jul 2009 19:45:47 +0000 (2 21:45 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 9 Sep 2009 03:33:38 +0000 (8 20:33 -0700)
treefb73eb876702d8e3d926c036255366847a99e1a6
parenta9baf6a17556ebc308cf569ef6459e486735717b
KVM: Fix KVM_GET_MSR_INDEX_LIST

commit e125e7b6944898831b56739a5448e705578bf7e2 upstream.

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.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kvm/x86.c