From: Martin Schwidefsky Date: Fri, 13 Mar 2015 10:19:09 +0000 (+0100) Subject: s390/mm: limit STACK_RND_MASK for compat tasks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e143fa93c28669a7f0851e6850b1da5b1945fd53;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git s390/mm: limit STACK_RND_MASK for compat tasks For compat tasks the mmap randomization does not use the maximum randomization value from mmap_rnd_mask but the fixed value of 0x7ff. This needs to be respected in the definition of STACK_RND_MASK as well. Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h index c9df40b5c0ac..c9c875d9ed31 100644 --- a/arch/s390/include/asm/elf.h +++ b/arch/s390/include/asm/elf.h @@ -211,7 +211,7 @@ do { \ extern unsigned long mmap_rnd_mask; -#define STACK_RND_MASK (mmap_rnd_mask) +#define STACK_RND_MASK (test_thread_flag(TIF_31BIT) ? 0x7ff : mmap_rnd_mask) #define ARCH_DLINFO \ do { \