alistair23-linux/arch/powerpc/mm
Rik van Riel 0a782dc31f powerpc,mmap: properly account for stack randomization in mmap_base
When RLIMIT_STACK is, for example, 256MB, the current code results in a
gap between the top of the task and mmap_base of 256MB, failing to take
into account the amount by which the stack address was randomized.  In
other words, the stack gets less than RLIMIT_STACK space.

Ensure that the gap between the stack and mmap_base always takes stack
randomization and the stack guard gap into account.

Inspired by Daniel Micay's linux-hardened tree.

Link: http://lkml.kernel.org/r/20170622200033.25714-4-riel@redhat.com
Signed-off-by: Rik van Riel <riel@redhat.com>
Reported-by: Florian Weimer <fweimer@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Daniel Micay <danielmicay@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-07-12 16:26:03 -07:00
..
8xx_mmu.c powerpc/mm: Rename map_page() to map_kernel_page() on 32-bit 2017-06-05 19:59:03 +10:00
40x_mmu.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
44x_mmu.c powerpc: Delete __cpuinit usage from all users 2013-07-01 11:10:36 +10:00
copro_fault.c powerpc/mm: Update PROTFAULT handling in the page fault path 2017-02-15 20:02:39 +11:00
dma-noncoherent.c powerpc/mm: Rename map_page() to map_kernel_page() on 32-bit 2017-06-05 19:59:03 +10:00
dump_hashpagetable.c powerpc/mm/ptdump: Dump the first entry of the linear mapping as well 2017-06-02 19:09:52 +10:00
dump_linuxpagetables.c powerpc/mm: Fix crash in page table dump with huge pages 2017-05-17 11:56:33 +10:00
fault.c powerpc/mm: The 8xx doesn't call do_page_fault() for breakpoints 2017-06-02 19:20:12 +10:00
fsl_booke_mmu.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
hash64_4k.c powerpc/mm: Fix lazy icache flush on pre-POWER5 2016-11-29 23:59:40 +11:00
hash64_64k.c powerpc/mm: Fix lazy icache flush on pre-POWER5 2016-11-29 23:59:40 +11:00
hash_low_32.S powerpc/32: Remove Mac-on-Linux/rtlinux hooks 2017-03-21 22:09:26 +11:00
hash_native_64.c powerpc/mm: Wire up hpte_removebolted for powernv 2017-07-02 20:40:28 +10:00
hash_utils_64.c powerpc/mm: Trace tlbie(l) instructions 2017-06-23 21:14:49 +10:00
highmem.c sched/preempt, mm/kmap: Explicitly disable/enable preemption in kmap_atomic_* 2015-05-19 08:39:14 +02:00
hugepage-hash64.c powerpc/mm: Move hash table ops to a separate structure 2016-07-21 18:59:09 +10:00
hugetlbpage-book3e.c powerpc/mm/nohash: MM_SLICE is only used by book3s 64 2017-03-31 23:09:47 +11:00
hugetlbpage-hash64.c powerpc/mm: Remove the debug hugepd_ok check 2017-01-23 19:19:28 +11:00
hugetlbpage-radix.c mm: larger stack guard gap, between vmas 2017-06-19 21:50:20 +08:00
hugetlbpage.c powerpc updates for 4.13 2017-07-07 13:55:45 -07:00
icswx.c scripts/spelling.txt: add regsiter -> register spelling mistake 2017-05-08 17:15:13 -07:00
icswx.h powerpc/icswx: Fix race condition with IPI setting ACOP 2012-03-07 17:06:09 +11:00
icswx_pid.c powerpc: Split ICSWX ACOP and PID processing 2011-11-25 14:11:27 +11:00
init-common.c Merge branch 'topic/ppc-kvm' into next 2017-02-14 17:18:29 +11:00
init_32.c powerpc/32: Add missing \n and switch to pr_warn() 2016-09-13 17:37:11 +10:00
init_64.c powerpc/vmemmap: Add altmap support 2017-07-02 20:40:27 +10:00
Makefile Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux into next 2016-12-16 15:05:38 +11:00
mem.c powerpc updates for 4.13 2017-07-07 13:55:45 -07:00
mmap.c powerpc,mmap: properly account for stack randomization in mmap_base 2017-07-12 16:26:03 -07:00
mmu_context_book3s64.c Merge branch 'fixes' into next 2017-07-03 23:05:43 +10:00
mmu_context_hash32.c powerpc: Remove power3 from comments 2014-07-28 14:10:26 +10:00
mmu_context_iommu.c Merge branch 'topic/ppc-kvm' into next 2017-04-28 20:19:37 +10:00
mmu_context_nohash.c powerpc/mm/nohash: MM_SLICE is only used by book3s 64 2017-03-31 23:09:47 +11:00
mmu_decl.h powerpc/mm: Rename map_page() to map_kernel_page() on 32-bit 2017-06-05 19:59:03 +10:00
numa.c powerpc: Only obtain cpu_hotplug_lock if called by rtasd 2017-06-23 09:32:11 +02:00
pgtable-book3e.c powerpc/mm: Make page table size a variable 2016-05-01 18:32:48 +10:00
pgtable-book3s64.c powerpc/mm: Add devmap support for ppc64 2017-07-02 20:40:28 +10:00
pgtable-hash64.c powerpc/mm/hash: Implement mark_rodata_ro() for hash 2017-07-04 11:35:16 +10:00
pgtable-radix.c powerpc/mm/radix: Implement STRICT_RWX/mark_rodata_ro() for Radix 2017-07-04 11:37:39 +10:00
pgtable.c powerpc/mm: Fix typo in set_pte_at() 2017-02-17 22:16:25 +11:00
pgtable_32.c powerpc/mm: Rename map_page() to map_kernel_page() on 32-bit 2017-06-05 19:59:03 +10:00
pgtable_64.c powerpc/mm/radix: Implement STRICT_RWX/mark_rodata_ro() for Radix 2017-07-04 11:37:39 +10:00
ppc_mmu_32.c powerpc32: refactor x_mapped_by_bats() and x_mapped_by_tlbcam() together 2016-03-11 17:18:02 -06:00
slb.c powerpc/64s: Rename slb_allocate_realmode() to slb_allocate() 2017-06-21 16:18:33 +10:00
slb_low.S powerpc/64s: Rename slb_allocate_realmode() to slb_allocate() 2017-06-21 16:18:33 +10:00
slice.c mm: larger stack guard gap, between vmas 2017-06-19 21:50:20 +08:00
subpage-prot.c powerpc/mm/radix: Use mm->task_size for boundary checking instead of addr_limit 2017-04-19 20:00:18 +10:00
tlb-radix.c powerpc/mm: Trace tlbie(l) instructions 2017-06-23 21:14:49 +10:00
tlb_hash32.c powerpc/mm: remove flush_tlb_page_nohash 2016-08-01 11:15:13 +10:00
tlb_hash64.c powerpc/mm/hash: Do a local flush if possible when no batch is active 2017-06-05 19:02:55 +10:00
tlb_low_64e.S powerpc: Fix misspellings in comments. 2016-03-01 19:27:20 +11:00
tlb_nohash.c powerpc/nohash: Fix use of mmu_has_feature() in setup_initial_memory_limit() 2017-04-11 07:46:04 +10:00
tlb_nohash_low.S powerpc: Fix misspellings in comments. 2016-03-01 19:27:20 +11:00
vphn.c powerpc/vphn: parsing code rewrite 2015-03-18 10:48:59 +11:00
vphn.h powerpc/vphn: parsing code rewrite 2015-03-18 10:48:59 +11:00