http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45979
--- Comment #5 from Mikael Pettersson <mikpe at it dot uu.se> 2010-10-13 13:57:28 UTC --- (In reply to comment #1) > Most likely when the linux arm kernel decided to randomize the heap. Confirmed. Bisection of the kernel identified: From: Nicolas Pitre <n...@fluxnic.net> Date: Tue, 15 Jun 2010 01:16:19 +0000 (-0400) Subject: [ARM] add address randomization to mmap() X-Git-Tag: v2.6.36-rc1~591^2^2~6^2~2 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=cc92c28b2db5b406657ecc05235d4ca4e222ae34 [ARM] add address randomization to mmap() Signed-off-by: Nicolas Pitre <nicolas.pi...@linaro.org> --- diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index f5abc51..4f5b396 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c @@ -7,6 +7,7 @@ #include <linux/shm.h> #include <linux/sched.h> #include <linux/io.h> +#include <linux/random.h> #include <asm/cputype.h> #include <asm/system.h> @@ -80,6 +81,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, start_addr = addr = TASK_UNMAPPED_BASE; mm->cached_hole_size = 0; } + /* 8 bits of randomness in 20 address space bits */ + if (current->flags & PF_RANDOMIZE) + addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT; full_search: if (do_align) as the cause of this regression. Still, I think the kernel is Ok and it's really gcc's pch implementation which is broken.