summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/binfmt_elf.c')
-rw-r--r--fs/binfmt_elf.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index d4e11b2e04f6..cec3b4146440 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -670,26 +670,6 @@ out:
670 * libraries. There is no binary dependent code anywhere else. 670 * libraries. There is no binary dependent code anywhere else.
671 */ 671 */
672 672
673#ifndef STACK_RND_MASK
674#define STACK_RND_MASK (0x7ff >> (PAGE_SHIFT - 12)) /* 8MB of VA */
675#endif
676
677static unsigned long randomize_stack_top(unsigned long stack_top)
678{
679 unsigned long random_variable = 0;
680
681 if (current->flags & PF_RANDOMIZE) {
682 random_variable = get_random_long();
683 random_variable &= STACK_RND_MASK;
684 random_variable <<= PAGE_SHIFT;
685 }
686#ifdef CONFIG_STACK_GROWSUP
687 return PAGE_ALIGN(stack_top) + random_variable;
688#else
689 return PAGE_ALIGN(stack_top) - random_variable;
690#endif
691}
692
693static int load_elf_binary(struct linux_binprm *bprm) 673static int load_elf_binary(struct linux_binprm *bprm)
694{ 674{
695 struct file *interpreter = NULL; /* to shut gcc up */ 675 struct file *interpreter = NULL; /* to shut gcc up */