diff options
| -rw-r--r-- | arch/arm/include/asm/elf.h | 3 | ||||
| -rw-r--r-- | arch/arm/kernel/process.c | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h index 51662feb9f1d..0a96e8c1b82a 100644 --- a/arch/arm/include/asm/elf.h +++ b/arch/arm/include/asm/elf.h | |||
| @@ -121,4 +121,7 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs); | |||
| 121 | extern void elf_set_personality(const struct elf32_hdr *); | 121 | extern void elf_set_personality(const struct elf32_hdr *); |
| 122 | #define SET_PERSONALITY(ex) elf_set_personality(&(ex)) | 122 | #define SET_PERSONALITY(ex) elf_set_personality(&(ex)) |
| 123 | 123 | ||
| 124 | extern unsigned long arch_randomize_brk(struct mm_struct *mm); | ||
| 125 | #define arch_randomize_brk arch_randomize_brk | ||
| 126 | |||
| 124 | #endif | 127 | #endif |
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 | } | ||
