diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-06-30 06:00:01 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-06-30 06:00:01 -0400 |
commit | fc4978b796e5e52ab3a709495a968199afe0a108 (patch) | |
tree | 102c74707940214f3c9810dadaf62d0d378a7a8c /arch/arm/mm | |
parent | 3260e5293727f16ffdce9a6a6203fd9a6b149e58 (diff) | |
parent | df0698be14c6683606d5df2d83e3ae40f85ed0d9 (diff) |
Merge git://git.linaro.org/nico/arm_security into devel-stable
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/mmap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index f5abc51c5a07..4f5b39687df5 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/shm.h> | 7 | #include <linux/shm.h> |
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | #include <linux/io.h> | 9 | #include <linux/io.h> |
10 | #include <linux/random.h> | ||
10 | #include <asm/cputype.h> | 11 | #include <asm/cputype.h> |
11 | #include <asm/system.h> | 12 | #include <asm/system.h> |
12 | 13 | ||
@@ -80,6 +81,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
80 | start_addr = addr = TASK_UNMAPPED_BASE; | 81 | start_addr = addr = TASK_UNMAPPED_BASE; |
81 | mm->cached_hole_size = 0; | 82 | mm->cached_hole_size = 0; |
82 | } | 83 | } |
84 | /* 8 bits of randomness in 20 address space bits */ | ||
85 | if (current->flags & PF_RANDOMIZE) | ||
86 | addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT; | ||
83 | 87 | ||
84 | full_search: | 88 | full_search: |
85 | if (do_align) | 89 | if (do_align) |