diff options
author | David Howells <dhowells@redhat.com> | 2009-01-08 07:04:47 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-01-08 07:04:47 -0500 |
commit | f4bbf51050a1e1dd485e9cd89eef4619a7453d71 (patch) | |
tree | 074dd5cc064e6fd0ddd0b73a56537943cda5068e /fs | |
parent | 38f714795b7cf4103c54152200ca66b524f8ed6e (diff) |
FDPIC: Don't attempt to expand the userspace stack to fill the space allocated
Stop the ELF-FDPIC binfmt from attempting to expand the userspace stack and brk
segments to fill the space actually allocated for it. The space allocated may
be rounded up by mmap(), and may be wasted.
However, finding out how much space we actually obtained uses the contentious
kobjsize() function which we'd like to get rid of as it doesn't necessarily
work for all slab allocators.
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Mike Frysinger <vapier.adi@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_elf_fdpic.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 22baf1b13493..f3e72c5c19f5 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -168,9 +168,6 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, | |||
168 | struct elf_fdpic_params exec_params, interp_params; | 168 | struct elf_fdpic_params exec_params, interp_params; |
169 | struct elf_phdr *phdr; | 169 | struct elf_phdr *phdr; |
170 | unsigned long stack_size, entryaddr; | 170 | unsigned long stack_size, entryaddr; |
171 | #ifndef CONFIG_MMU | ||
172 | unsigned long fullsize; | ||
173 | #endif | ||
174 | #ifdef ELF_FDPIC_PLAT_INIT | 171 | #ifdef ELF_FDPIC_PLAT_INIT |
175 | unsigned long dynaddr; | 172 | unsigned long dynaddr; |
176 | #endif | 173 | #endif |
@@ -390,11 +387,6 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, | |||
390 | goto error_kill; | 387 | goto error_kill; |
391 | } | 388 | } |
392 | 389 | ||
393 | /* expand the stack mapping to use up the entire allocation granule */ | ||
394 | fullsize = kobjsize((char *) current->mm->start_brk); | ||
395 | if (!IS_ERR_VALUE(do_mremap(current->mm->start_brk, stack_size, | ||
396 | fullsize, 0, 0))) | ||
397 | stack_size = fullsize; | ||
398 | up_write(¤t->mm->mmap_sem); | 390 | up_write(¤t->mm->mmap_sem); |
399 | 391 | ||
400 | current->mm->brk = current->mm->start_brk; | 392 | current->mm->brk = current->mm->start_brk; |