diff options
| -rw-r--r-- | arch/x86/mm/mmap.c | 6 | ||||
| -rw-r--r-- | fs/binfmt_elf.c | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c index 919b91205cd4..df4552bd239e 100644 --- a/arch/x86/mm/mmap.c +++ b/arch/x86/mm/mmap.c | |||
| @@ -35,12 +35,12 @@ struct va_alignment __read_mostly va_align = { | |||
| 35 | .flags = -1, | 35 | .flags = -1, |
| 36 | }; | 36 | }; |
| 37 | 37 | ||
| 38 | static unsigned int stack_maxrandom_size(void) | 38 | static unsigned long stack_maxrandom_size(void) |
| 39 | { | 39 | { |
| 40 | unsigned int max = 0; | 40 | unsigned long max = 0; |
| 41 | if ((current->flags & PF_RANDOMIZE) && | 41 | if ((current->flags & PF_RANDOMIZE) && |
| 42 | !(current->personality & ADDR_NO_RANDOMIZE)) { | 42 | !(current->personality & ADDR_NO_RANDOMIZE)) { |
| 43 | max = ((-1U) & STACK_RND_MASK) << PAGE_SHIFT; | 43 | max = ((-1UL) & STACK_RND_MASK) << PAGE_SHIFT; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | return max; | 46 | return max; |
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: | |||
| 645 | 645 | ||
| 646 | static unsigned long randomize_stack_top(unsigned long stack_top) | 646 | static unsigned long randomize_stack_top(unsigned long stack_top) |
| 647 | { | 647 | { |
| 648 | unsigned int random_variable = 0; | 648 | unsigned long random_variable = 0; |
| 649 | 649 | ||
| 650 | if ((current->flags & PF_RANDOMIZE) && | 650 | if ((current->flags & PF_RANDOMIZE) && |
| 651 | !(current->personality & ADDR_NO_RANDOMIZE)) { | 651 | !(current->personality & ADDR_NO_RANDOMIZE)) { |
| 652 | random_variable = get_random_int() & STACK_RND_MASK; | 652 | random_variable = (unsigned long) get_random_int(); |
| 653 | random_variable &= STACK_RND_MASK; | ||
| 653 | random_variable <<= PAGE_SHIFT; | 654 | random_variable <<= PAGE_SHIFT; |
| 654 | } | 655 | } |
| 655 | #ifdef CONFIG_STACK_GROWSUP | 656 | #ifdef CONFIG_STACK_GROWSUP |
