diff options
author | Nicolas Pitre <nico@fluxnic.net> | 2010-06-14 16:27:19 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2010-06-14 21:22:11 -0400 |
commit | 990cb8acf23cab19a2930f1ed5e7dc108f89079b (patch) | |
tree | 005c4b9343ae0fac6f9b561ab3c6f3db06fbfce0 /arch/arm/kernel/process.c | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
[ARM] implement arch_randomize_brk()
For this feature to take effect, CONFIG_COMPAT_BRK must be turned
off. This can safely be turned off for any EABI user space versions.
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/kernel/process.c')
-rw-r--r-- | arch/arm/kernel/process.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index acf5e6fdb6dc..1c6eb7ed9642 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/tick.h> | 28 | #include <linux/tick.h> |
29 | #include <linux/utsname.h> | 29 | #include <linux/utsname.h> |
30 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
31 | #include <linux/random.h> | ||
31 | 32 | ||
32 | #include <asm/leds.h> | 33 | #include <asm/leds.h> |
33 | #include <asm/processor.h> | 34 | #include <asm/processor.h> |
@@ -421,3 +422,9 @@ unsigned long get_wchan(struct task_struct *p) | |||
421 | } while (count ++ < 16); | 422 | } while (count ++ < 16); |
422 | return 0; | 423 | return 0; |
423 | } | 424 | } |
425 | |||
426 | unsigned long arch_randomize_brk(struct mm_struct *mm) | ||
427 | { | ||
428 | unsigned long range_end = mm->brk + 0x02000000; | ||
429 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; | ||
430 | } | ||