]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Fix the NULL pointer parameter in check_cr_write()
authorYu Zhang <yu.c.zhang@linux.intel.com>
Mon, 18 Sep 2017 10:45:01 +0000 (18:45 +0800)
committerRadim Krčmář <rkrcmar@redhat.com>
Tue, 19 Sep 2017 12:28:58 +0000 (14:28 +0200)
commit828da15203392baaf3e8339305731a37c4d94ec9
tree63bebe3b669b051526b608e50db1fbdc4c753d94
parente7f3fc1761c1c322740f034b2072668b2c1b230f
KVM: x86: Fix the NULL pointer parameter in check_cr_write()

Routine check_cr_write() will trigger emulator_get_cpuid()->
kvm_cpuid() to get maxphyaddr, and NULL is passed as values
for ebx/ecx/edx. This is problematic because kvm_cpuid() will
dereference these pointers.

Fixes: 4b320143a241 ("KVM: MMU: check guest CR3 reserved bits based on its physical address width.")
Reported-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/emulate.c