]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
MIPS: KVM: Add missing gfn range check
authorJames Hogan <james.hogan@imgtec.com>
Thu, 18 Aug 2016 09:05:30 +0000 (10:05 +0100)
committerKamal Mostafa <kamal@canonical.com>
Mon, 22 Aug 2016 14:42:32 +0000 (07:42 -0700)
commitdf60f2c4212f31093439ad0d64c3cc4d8242fa0e
treeb8702954d2f3e94860f6c1c13911560410f97596
parent5585ee4f59b06cd1072fd2844cbb70389afa93c3
MIPS: KVM: Add missing gfn range check

BugLink: http://bugs.launchpad.net/bugs/1615620
commit 8985d50382359e5bf118fdbefc859d0dbf6cebc7 upstream.

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
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
[james.hogan@imgtec.com: Backport to v3.17.y - v4.4.y]
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
arch/mips/kvm/tlb.c