diff options
| author | dcashman <dcashman@google.com> | 2016-02-24 13:31:22 -0800 |
|---|---|---|
| committer | Dmitry Shmidt <dimitrysh@google.com> | 2016-03-16 16:50:34 -0700 |
| commit | b471fcdaec3d419ddcbe416568f3f9ce7f1e9ef8 (patch) | |
| tree | a846f76ac7355667d29dfb8ad1b0ae8493738f79 /fs/binfmt_elf.c | |
| parent | 9a3fe392e468775da2b63a813f60b923eb6476c5 (diff) | |
FROMLIST: mm: ASLR: use get_random_long()
(cherry picked from commit https://lkml.org/lkml/2016/2/4/833)
Replace calls to get_random_int() followed by a cast to (unsigned long)
with calls to get_random_long(). Also address shifting bug which, in case
of x86 removed entropy mask for mmap_rnd_bits values > 31 bits.
Bug: 26963541
Signed-off-by: Daniel Cashman <dcashman@android.com>
Signed-off-by: Daniel Cashman <dcashman@google.com>
Change-Id: I36c156c9b8d7d157134895fddd4cd6efddcbee86
Diffstat (limited to 'fs/binfmt_elf.c')
| -rw-r--r-- | fs/binfmt_elf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 3a93755e880f..0c52941dd62c 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -651,7 +651,7 @@ static unsigned long randomize_stack_top(unsigned long stack_top) if ((current->flags & PF_RANDOMIZE) && !(current->personality & ADDR_NO_RANDOMIZE)) { - random_variable = (unsigned long) get_random_int(); + random_variable = get_random_long(); random_variable &= STACK_RND_MASK; random_variable <<= PAGE_SHIFT; } |
