linux/arch/mips
David Daney 1ec56329ff MIPS: Check for accesses beyond the end of the PGD.
For some combinations of PAGE_SIZE and vmbits, it is possible to have
userspace access that are beyond what is covered by the PGD, but within
vmbits.  Such an access would cause the TLB refill handler to load garbage
values for PMD and PTE potentially giving userspace access to parts of the
physical address space to which it is not entitled.

In the TLB refill hot path, we add a single dsrl instruction so we can
check if any bits outside of the range covered by the PGD are set.  In
the vmalloc side we then separate the bad case from the normal vmalloc
case and call tlb_do_page_fault_0 if warranted.  This slows us down a
bit, but has the benefit of yielding deterministic behavior.

[Ralf: Fixed build error for 32-bit kernels.]
[Ralf: Folded lmo commit c8c0e22b2aa3982852b44279638ef37f9aa31b7d into this
 commit.]

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/1152/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

---
2010-04-30 20:52:48 +01:00
..
alchemy MIPS: DB1200: PCMCIA card detection must not be auto-enabled. 2010-04-30 20:52:43 +01:00
ar7 MIPS: AR7: Fix phat finger of cpmac fixed_phy_add 2010-04-12 17:26:13 +01:00
bcm47xx MIPS: Nuke trailing blank lines 2010-02-27 12:53:14 +01:00
bcm63xx MIPS: BCM63xx: Fix build failure in board_bcm963xx.c 2010-04-12 17:26:20 +01:00
boot MIPS: Make the debugging of compressed kernel configurable 2010-02-27 12:53:24 +01:00
cavium-octeon MIPS: Octeon: Remove redundant declaration of octeon_reserve32_memory 2010-04-12 17:26:10 +01:00
cobalt MIPS: Cobalt: Fix theoretical port aliasing issue 2010-02-27 12:53:43 +01:00
configs MIPS: Big Sur: Make defconfig more useful. 2010-04-12 17:26:22 +01:00
dec MIPS: DEC: Convert KN01 lock to raw spinlock. 2010-02-27 12:53:36 +01:00
emma MIPS: Remove useless zero initializations. 2009-09-17 20:07:51 +02:00
fw MIPS: IP22: Remove an unused function 2009-12-17 01:56:56 +00:00
gt64120/wrppmc Update Yoichi Yuasa's e-mail address 2009-07-03 15:45:29 +01:00
include/asm MIPS: Add uasm_i_dsrl_safe() and uasm_i_dsll_safe() to uasm. 2010-04-30 20:52:45 +01:00
jazz MIPS: Fixup screen_info struct initializations 2010-04-30 20:52:42 +01:00
kernel MIPS: die() does not call die notifier chain 2010-04-30 20:52:45 +01:00
lasat MIPS: Nuke trailing blank lines 2010-02-27 12:53:14 +01:00
lib MIPS: libgcc.h: Checkpatch cleanup 2010-04-12 17:26:15 +01:00
loongson MIPS: Fixup screen_info struct initializations 2010-04-30 20:52:42 +01:00
math-emu MIPS: Nuke trailing blank lines 2010-02-27 12:53:14 +01:00
mipssim include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mm MIPS: Check for accesses beyond the end of the PGD. 2010-04-30 20:52:48 +01:00
mti-malta include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
nxp MIPS: PNX8550: Fix build error, broken by: 2010-04-30 20:52:39 +01:00
oprofile MIPS: Loongson: Remove pointless sample_lock from oprofile code. 2010-02-27 12:53:39 +01:00
pci MIPS: SB1250: Include correct header and fix a warning 2010-04-30 20:52:43 +01:00
pmc-sierra include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
power MIPS: Loongson: Change the Email address of Wu Zhangjin 2010-02-27 12:53:12 +01:00
powertv include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
rb532 include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sgi-ip22 MIPS: die() does not call die notifier chain 2010-04-30 20:52:45 +01:00
sgi-ip27 include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sgi-ip32 include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sibyte MIPS: Fixup screen_info struct initializations 2010-04-30 20:52:42 +01:00
sni MIPS: SNI: Convert sni_rm200_i8259A_lock to raw spinlock. 2010-02-27 12:53:39 +01:00
txx9 include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
vr41xx MIPS: VR41xx: Use strlcat() for the command line arguments 2010-01-12 18:19:30 +01:00
Kconfig MIPS: Swarm, Littlesur: Enable PATA platform driver. 2010-04-30 20:52:44 +01:00
Kconfig.debug MIPS: Crazy spinlock speed test. 2010-02-27 12:53:42 +01:00
Makefile MIPS: Loongson: arch/mips/Makefile: Add missing whitespace 2010-02-27 12:53:11 +01:00