From 190398367426d64909c08179d663142d6fee04d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Thu, 29 May 2014 06:21:29 +0000 Subject: main/linux-rpi: new kernel flavor Vanilla kernel with Raspberry Pi patches (no grsec) default config for rpi --- main/linux-rpi/aslr-pie.patch | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 main/linux-rpi/aslr-pie.patch (limited to 'main/linux-rpi/aslr-pie.patch') diff --git a/main/linux-rpi/aslr-pie.patch b/main/linux-rpi/aslr-pie.patch new file mode 100644 index 0000000000..a31dba42a8 --- /dev/null +++ b/main/linux-rpi/aslr-pie.patch @@ -0,0 +1,30 @@ +--- linux-3.11/fs/binfmt_elf.c.orig ++++ linux-3.11/fs/binfmt_elf.c +@@ -802,21 +802,19 @@ + * default mmap base, as well as whatever program they + * might try to exec. This is because the brk will + * follow the loader, and is not movable. */ ++ if (elf_interpreter) ++ load_bias = 0x00400000UL; ++ else ++ load_bias = ELF_ET_DYN_BASE; + #ifdef CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE + /* Memory randomization might have been switched off + * in runtime via sysctl or explicit setting of + * personality flags. +- * If that is the case, retain the original non-zero +- * load_bias value in order to establish proper +- * non-randomized mappings. + */ + if (current->flags & PF_RANDOMIZE) +- load_bias = 0; +- else +- load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr); +-#else +- load_bias = ELF_PAGESTART(ELF_ET_DYN_BASE - vaddr); ++ load_bias += (get_random_int() & STACK_RND_MASK) << PAGE_SHIFT; + #endif ++ load_bias = ELF_PAGESTART(load_bias - vaddr); + } + + error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, -- cgit v1.2.3