aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/math-emu/sp_scalb.c
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2010-04-28 12:16:18 -0700
committerRalf Baechle <ralf@linux-mips.org>2010-04-30 20:52:48 +0100
commit1ec56329ff939aba29291c0dec1a28ceed660162 (patch)
tree45788e1f4f0baef44d727e7ca31821c16ba6317f /arch/mips/math-emu/sp_scalb.c
parent3be6022c27ace1e3b4ba963e7ffd2e3b60cecd8a (diff)
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> ---
Diffstat (limited to 'arch/mips/math-emu/sp_scalb.c')
0 files changed, 0 insertions, 0 deletions