aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/process_32.c7
-rw-r--r--arch/x86/kernel/process_64.c7
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index a8cdd09ad53f..631af167bc51 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -992,3 +992,10 @@ unsigned long arch_align_stack(unsigned long sp)
992 sp -= get_random_int() % 8192; 992 sp -= get_random_int() % 8192;
993 return sp & ~0xf; 993 return sp & ~0xf;
994} 994}
995
996unsigned long arch_randomize_brk(struct mm_struct *mm)
997{
998 unsigned long range_end = mm->brk + 0x02000000;
999 return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
1000}
1001
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 98d85952f574..aa9414ed74c7 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -914,3 +914,10 @@ unsigned long arch_align_stack(unsigned long sp)
914 sp -= get_random_int() % 8192; 914 sp -= get_random_int() % 8192;
915 return sp & ~0xf; 915 return sp & ~0xf;
916} 916}
917
918unsigned long arch_randomize_brk(struct mm_struct *mm)
919{
920 unsigned long range_end = mm->brk + 0x02000000;
921 return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
922}
923