summaryrefslogtreecommitdiff
path: root/arch/mips/kvm/commpage.c
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2016-06-15 19:29:57 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2016-06-15 23:58:36 +0200
commit42aa12e74e91f790d239bfb852260d07573ce83f (patch)
treecf476b04bf159f8959fcce5340130bb823fbe1b2 /arch/mips/kvm/commpage.c
parent05108709526716e1d40210fe3b9d7acd1cb694ea (diff)
MIPS: KVM: Move commpage so 0x0 is unmapped
The comm page which is mapped into the guest kernel address space at 0x0 has the unfortunate side effect of allowing guest kernel NULL pointer dereferences to succeed. The only constraint on this address is that it must be within 32KiB of 0x0, so that single lw/sw instructions (which have 16-bit signed offset fields) can be used to access it, using the zero register as a base. So lets move the comm page as high as possible within that constraint so that 0x0 can be left unmapped, at least for page sizes < 32KiB. 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: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/kvm/commpage.c')
-rw-r--r--arch/mips/kvm/commpage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kvm/commpage.c b/arch/mips/kvm/commpage.c
index 2d6e976d1add..a36b77e1705c 100644
--- a/arch/mips/kvm/commpage.c
+++ b/arch/mips/kvm/commpage.c
@@ -4,7 +4,7 @@
* for more details.
*
* commpage, currently used for Virtual COP0 registers.
- * Mapped into the guest kernel @ 0x0.
+ * Mapped into the guest kernel @ KVM_GUEST_COMMPAGE_ADDR.
*
* Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
* Authors: Sanjay Lal <sanjayl@kymasys.com>