aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@ZenIV.linux.org.uk>2012-03-05 01:38:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-05 16:51:32 -0500
commit6414fa6a150111750011f477899d370244da4171 (patch)
tree3ce9a86bf828b9b61ee77e74786a2cdd716bf154 /arch
parent550cf00dbc8ee402bef71628cb71246493dd4500 (diff)
aout: move setup_arg_pages() prior to reading/mapping the binary
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/ia32/ia32_aout.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index fd843877e841..39e49091f648 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -315,6 +315,13 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
315 current->mm->free_area_cache = TASK_UNMAPPED_BASE; 315 current->mm->free_area_cache = TASK_UNMAPPED_BASE;
316 current->mm->cached_hole_size = 0; 316 current->mm->cached_hole_size = 0;
317 317
318 retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT);
319 if (retval < 0) {
320 /* Someone check-me: is this error path enough? */
321 send_sig(SIGKILL, current, 0);
322 return retval;
323 }
324
318 install_exec_creds(bprm); 325 install_exec_creds(bprm);
319 current->flags &= ~PF_FORKNOEXEC; 326 current->flags &= ~PF_FORKNOEXEC;
320 327
@@ -410,13 +417,6 @@ beyond_if:
410 417
411 set_brk(current->mm->start_brk, current->mm->brk); 418 set_brk(current->mm->start_brk, current->mm->brk);
412 419
413 retval = setup_arg_pages(bprm, IA32_STACK_TOP, EXSTACK_DEFAULT);
414 if (retval < 0) {
415 /* Someone check-me: is this error path enough? */
416 send_sig(SIGKILL, current, 0);
417 return retval;
418 }
419
420 current->mm->start_stack = 420 current->mm->start_stack =
421 (unsigned long)create_aout_tables((char __user *)bprm->p, bprm); 421 (unsigned long)create_aout_tables((char __user *)bprm->p, bprm);
422 /* start thread */ 422 /* start thread */