diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-08-24 10:12:33 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-08-24 10:12:33 +0200 |
commit | 93da8b221da95a97316e518c94f03856e5d610a9 (patch) | |
tree | 23787f3c0d02507f20d804aac23ef209d66a7586 /arch/x86/mm/mmap.c | |
parent | ba63f76e22ee723819c8cec86b31f7ea3182b2ed (diff) | |
parent | 143c97cc652949893c8056c679012f0aeccb80e5 (diff) | |
download | talos-obmc-linux-93da8b221da95a97316e518c94f03856e5d610a9.tar.gz talos-obmc-linux-93da8b221da95a97316e518c94f03856e5d610a9.zip |
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/mm/mmap.c')
-rw-r--r-- | arch/x86/mm/mmap.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c index 229d04a83f85..a88cfbfbd078 100644 --- a/arch/x86/mm/mmap.c +++ b/arch/x86/mm/mmap.c @@ -50,8 +50,7 @@ unsigned long tasksize_64bit(void) static unsigned long stack_maxrandom_size(unsigned long task_size) { unsigned long max = 0; - if ((current->flags & PF_RANDOMIZE) && - !(current->personality & ADDR_NO_RANDOMIZE)) { + if (current->flags & PF_RANDOMIZE) { max = (-1UL) & __STACK_RND_MASK(task_size == tasksize_32bit()); max <<= PAGE_SHIFT; } @@ -79,13 +78,13 @@ static int mmap_is_legacy(void) static unsigned long arch_rnd(unsigned int rndbits) { + if (!(current->flags & PF_RANDOMIZE)) + return 0; return (get_random_long() & ((1UL << rndbits) - 1)) << PAGE_SHIFT; } unsigned long arch_mmap_rnd(void) { - if (!(current->flags & PF_RANDOMIZE)) - return 0; return arch_rnd(mmap_is_ia32() ? mmap32_rnd_bits : mmap64_rnd_bits); } |