• James Hogan's avatar
    MIPS: KVM: Add missing gfn range check · 6203a4c3
    James Hogan authored
    commit 8985d503 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: 858dd5d4 ("KVM/MIPS32: MMU/TLB operations for the Guest.")
    Signed-off-by: default avatarJames 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: default avatarRadim Krčmář <rkrcmar@redhat.com>
    [bwh: Backported to 3.16: adjust filename, context]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    6203a4c3
kvm_tlb.c 20.6 KB