WSL2-Linux-Kernel/arch/mips/mm
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
..
Makefile MIPS: Add support files for hugetlbfs. 2009-06-17 11:06:30 +01:00
c-octeon.c MIPS: Give Octeon+ CPUs their own cputype. 2010-02-27 12:53:26 +01:00
c-r3k.c MIPS: Build fix - include <linux/smp.h> into all smp_processor_id() users. 2009-06-24 18:34:39 +01:00
c-r4k.c MIPS: Build fix - include <linux/smp.h> into all smp_processor_id() users. 2009-06-24 18:34:39 +01:00
c-tx39.c MIPS: Build fix - include <linux/smp.h> into all smp_processor_id() users. 2009-06-24 18:34:39 +01:00
cache.c MIPS: Fix __vmalloc() etc. on MIPS for non-GPL modules 2010-04-12 17:26:21 +01:00
cerr-sb1.c MIPS: Sibyte: Use hweight8 instead of counting bits 2009-12-17 01:57:16 +00:00
cex-gen.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cex-oct.S MIPS: Add Cavium OCTEON processor support files to arch/mips/cavium-octeon. 2009-01-11 09:57:21 +00:00
cex-sb1.S [MIPS] Fix loads of section missmatches 2008-03-12 14:14:41 +00:00
dma-default.c 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
extable.c MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
fault.c MIPS: Implement Read Inhibit/eXecute Inhibit 2010-02-27 12:53:26 +01:00
highmem.c MIPS: Highmem: Fix build error 2010-02-22 21:42:11 +01:00
hugetlbpage.c 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
init.c 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
ioremap.c 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
page.c MIPS: Move arch/mips/mm/uasm.h to arch/mips/include/asm/uasm.h 2010-02-27 12:53:19 +01:00
pgtable-32.c [MIPS] Add external declaration of pagetable_init() to pgalloc.h 2007-02-18 21:31:36 +00:00
pgtable-64.c MIPS: Two-level pagetables for 64-bit kernels with 64KB pages. 2010-02-27 12:53:03 +01:00
sc-ip22.c MIPS: IP22: Make indy_sc_ops variable static 2008-11-20 19:42:33 +00:00
sc-mips.c MIPS: MIPSxx SC: Avoid destructive invalidation on partial L2 cachelines. 2009-09-30 21:47:00 +02:00
sc-r5k.c [MIPS] Fix loads of section missmatches 2008-03-12 14:14:41 +00:00
sc-rm7k.c MIPS: IP32: Two symbols can become static 2009-05-14 13:50:24 +01:00
tlb-r3k.c MIPS: Build fix - include <linux/smp.h> into all smp_processor_id() users. 2009-06-24 18:34:39 +01:00
tlb-r4k.c MIPS: Implement Read Inhibit/eXecute Inhibit 2010-02-27 12:53:26 +01:00
tlb-r8k.c MIPS: Build fix - include <linux/smp.h> into all smp_processor_id() users. 2009-06-24 18:34:39 +01:00
tlbex-fault.S [MIPS] Stacktrace build-fix and improvement 2006-10-01 23:16:58 +01:00
tlbex.c MIPS: Check for accesses beyond the end of the PGD. 2010-04-30 20:52:48 +01:00
uasm.c MIPS: uasm: Add OR instruction. 2010-04-12 17:26:20 +01:00