MIPS: KVM: Add missing gfn range check
authorJames Hogan <james.hogan@imgtec.com>
Thu, 11 Aug 2016 10:58:13 +0000 (11:58 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 12 Aug 2016 10:01:28 +0000 (12:01 +0200)
commit8985d50382359e5bf118fdbefc859d0dbf6cebc7
tree90e23e5a2b3f3e6cce8fa1bfe6d0b3609efb48cd
parentc604cffa93478f8888bec62b23d6073dad03d43a
MIPS: KVM: Add missing gfn range check

kvm_mips_handle_mapped_seg_tlb_fault() calculates the guest frame number
based on the guest TLB EntryLo values, however it is not range checked
to ensure it lies within the guest_pmap. If the physical memory the
guest refers to is out of range then dump the guest TLB and emit an
internal error.

Fixes: 858dd5d45733 ("KVM/MIPS32: MMU/TLB operations for the Guest.")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: <stable@vger.kernel.org> # 3.10.x-
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/mips/kvm/mmu.c