diff options
author | James Hogan <james.hogan@imgtec.com> | 2016-08-11 11:58:12 +0100 |
---|---|---|
committer | Radim Krčmář <rkrcmar@redhat.com> | 2016-08-12 12:01:28 +0200 |
commit | c604cffa93478f8888bec62b23d6073dad03d43a (patch) | |
tree | 9701dba5cce0491bb6ba15f183239d7e6cc07a10 /fs/fs_struct.c | |
parent | a28ebea2adc4a2bef5989a5a181ec238f59fbcad (diff) | |
download | linux-c604cffa93478f8888bec62b23d6073dad03d43a.tar.bz2 |
MIPS: KVM: Fix mapped fault broken commpage handling
kvm_mips_handle_mapped_seg_tlb_fault() appears to map the guest page at
virtual address 0 to PFN 0 if the guest has created its own mapping
there. The intention is unclear, but it may have been an attempt to
protect the zero page from being mapped to anything but the comm page in
code paths you wouldn't expect from genuine commpage accesses (guest
kernel mode cache instructions on that address, hitting trapping
instructions when executing from that address with a coincidental TLB
eviction during the KVM handling, and guest user mode accesses to that
address).
Fix this to check for mappings exactly at KVM_GUEST_COMMPAGE_ADDR (it
may not be at address 0 since commit 42aa12e74e91 ("MIPS: KVM: Move
commpage so 0x0 is unmapped")), and set the corresponding EntryLo to be
interpreted as 0 (invalid).
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>
Diffstat (limited to 'fs/fs_struct.c')
0 files changed, 0 insertions, 0 deletions