diff options
author | Ingo Molnar | 2015-02-19 12:06:04 +0100 |
---|---|---|
committer | Ingo Molnar | 2015-02-19 12:31:34 +0100 |
commit | a267b0a349bb021c010e36a2a13e1e16657b1b0f (patch) | |
tree | 4438a10ecc864f15ce6f37c1764fffa995a9a175 /fs | |
parent | ee408b4207c8281a91f039e89d06de264d319466 (diff) | |
parent | 4e7c22d447bb6d7e37bfe39ff658486ae78e8d77 (diff) |
Merge branch 'tip-x86-kaslr' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp into x86/urgent
Pull ASLR and kASLR fixes from Borislav Petkov:
- Add a global flag announcing KASLR state so that relevant code can do
informed decisions based on its setting. (Jiri Kosina)
- Fix a stack randomization entropy decrease bug. (Hector Marco-Gisbert)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_elf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 02b16910f4c9..995986b8e36b 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -645,11 +645,12 @@ out: static unsigned long randomize_stack_top(unsigned long stack_top) { - unsigned int random_variable = 0; + unsigned long random_variable = 0; if ((current->flags & PF_RANDOMIZE) && !(current->personality & ADDR_NO_RANDOMIZE)) { - random_variable = get_random_int() & STACK_RND_MASK; + random_variable = (unsigned long) get_random_int(); + random_variable &= STACK_RND_MASK; random_variable <<= PAGE_SHIFT; } #ifdef CONFIG_STACK_GROWSUP |