summaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2015-04-14 15:48:04 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-14 16:49:05 -0700
commitc6f5b001e65cdac592b65a08c5d2dd179cfba568 (patch)
tree3039e744e13eac169969882aed3226a8f6ce6186 /arch/s390/mm
parent2b68f6caeac271620cd2f9362aeaed360e317df0 (diff)
downloadblackbird-op-linux-c6f5b001e65cdac592b65a08c5d2dd179cfba568.tar.gz
blackbird-op-linux-c6f5b001e65cdac592b65a08c5d2dd179cfba568.zip
s390: redefine randomize_et_dyn for ELF_ET_DYN_BASE
In preparation for moving ET_DYN randomization into the ELF loader (which requires a static ELF_ET_DYN_BASE), this redefines s390's existing ET_DYN randomization in a call to arch_mmap_rnd(). This refactoring results in the same ET_DYN randomization on s390. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Reviewed-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/mmap.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
index a94504d99c47..8c11536f972d 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
@@ -179,17 +179,10 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
unsigned long randomize_et_dyn(void)
{
- unsigned long base;
-
- base = STACK_TOP / 3 * 2;
- if (!is_32bit_task())
- /* Align to 4GB */
- base &= ~((1UL << 32) - 1);
-
if (current->flags & PF_RANDOMIZE)
- base += arch_mmap_rnd();
+ return arch_mmap_rnd();
- return base;
+ return 0UL;
}
#ifndef CONFIG_64BIT
OpenPOWER on IntegriCloud