Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 6877/1: the ADDR_NO_RANDOMIZE personality flag should be honored with mmap()

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Nicolas Pitre and committed by
Russell King
df5419a9 b025a3f8

+3 -1
+3 -1
arch/arm/mm/mmap.c
··· 7 7 #include <linux/shm.h> 8 8 #include <linux/sched.h> 9 9 #include <linux/io.h> 10 + #include <linux/personality.h> 10 11 #include <linux/random.h> 11 12 #include <asm/cputype.h> 12 13 #include <asm/system.h> ··· 83 82 mm->cached_hole_size = 0; 84 83 } 85 84 /* 8 bits of randomness in 20 address space bits */ 86 - if (current->flags & PF_RANDOMIZE) 85 + if ((current->flags & PF_RANDOMIZE) && 86 + !(current->personality & ADDR_NO_RANDOMIZE)) 87 87 addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT; 88 88 89 89 full_search: