parisc: add flexible mmap layout support
Subsystems (2)
Helge Deller
maintainerPATCH 1/1 parisc: add flexible mmap layout support
- initial version
- add mmap address & stack randomization
- probably fixes a few other bugs in the mmap code
- can be enabled/turned off by "echo 0/1 > /proc/sys/vm/legacy_va_layout
- new flexible mmap layout is by default turned on
Signed-off-by Helge Deller <[email protected]>
arch/parisc/include/asm/elf.h +7 -0
@@ -348,4 +348,11 @@ struct pt_regs; /* forward declaration... */#define ELF_HWCAP 0 +/* Stack randomization: 1GB for 64bit, 8MB for 32bit */ +#ifdef CONFIG_64BIT +# define STACK_RND_MASK (test_thread_flag(TIF_32BIT) ? 0x7ff : 0x3fffff) +#else +# define STACK_RND_MASK (0x7ff) +#endif +#endif
arch/parisc/include/asm/pgtable.h +1 -0
@@ -511,6 +511,7 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,/* We provide our own get_unmapped_area to provide cache coherency */ #define HAVE_ARCH_UNMAPPED_AREA +#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
arch/parisc/include/asm/processor.h +2 -0
@@ -30,6 +30,8 @@#endif #define current_text_addr () ({ void *pc; current_ia(pc); pc; }) +#define HAVE_ARCH_PICK_MMAP_LAYOUT +#define TASK_SIZE_OF (tsk) ((tsk)->thread.task_size)#define TASK_SIZE TASK_SIZE_OF(current)#define TASK_UNMAPPED_BASE (current->thread.map_base)
arch/parisc/kernel/sys_parisc.c +190 -28
264 lines not on this page · raw message