summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/process.c')
-rw-r--r--arch/s390/kernel/process.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 26d48fe72999..a895e69379f7 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -359,3 +359,14 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
return mm->brk;
return ret;
}
+
+unsigned long randomize_et_dyn(unsigned long base)
+{
+ unsigned long ret = PAGE_ALIGN(base + brk_rnd());
+
+ if (!(current->flags & PF_RANDOMIZE))
+ return base;
+ if (ret < base)
+ return base;
+ return ret;
+}