Skip to content

Commit

Permalink
take removal of PF_FORKNOEXEC to flush_old_exec()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Mar 21, 2012
1 parent e59cc47 commit 19e5109
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion arch/x86/ia32/ia32_aout.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
}

install_exec_creds(bprm);
current->flags &= ~PF_FORKNOEXEC;

if (N_MAGIC(ex) == OMAGIC) {
unsigned long text_addr, map_size;
Expand Down
1 change: 0 additions & 1 deletion fs/binfmt_aout.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ static int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs)
}

install_exec_creds(bprm);
current->flags &= ~PF_FORKNOEXEC;

if (N_MAGIC(ex) == OMAGIC) {
unsigned long text_addr, map_size;
Expand Down
2 changes: 0 additions & 2 deletions fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
goto out_free_dentry;

/* OK, This is the point of no return */
current->flags &= ~PF_FORKNOEXEC;
current->mm->def_flags = def_flags;

/* Do this immediately, since STACK_TOP as used in setup_arg_pages
Expand Down Expand Up @@ -934,7 +933,6 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
#endif /* ARCH_HAS_SETUP_ADDITIONAL_PAGES */

install_exec_creds(bprm);
current->flags &= ~PF_FORKNOEXEC;
retval = create_elf_tables(bprm, &loc->elf_ex,
load_addr, interp_load_addr);
if (retval < 0) {
Expand Down
3 changes: 0 additions & 3 deletions fs/binfmt_elf_fdpic.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,6 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm,
current->mm->context.exec_fdpic_loadmap = 0;
current->mm->context.interp_fdpic_loadmap = 0;

current->flags &= ~PF_FORKNOEXEC;

#ifdef CONFIG_MMU
elf_fdpic_arch_lay_out_mm(&exec_params,
&interp_params,
Expand Down Expand Up @@ -414,7 +412,6 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm,
#endif

install_exec_creds(bprm);
current->flags &= ~PF_FORKNOEXEC;
if (create_elf_fdpic_tables(bprm, current->mm,
&exec_params, &interp_params) < 0)
goto error_kill;
Expand Down
1 change: 0 additions & 1 deletion fs/binfmt_flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,6 @@ static int load_flat_binary(struct linux_binprm * bprm, struct pt_regs * regs)
libinfo.lib_list[j].start_data:UNLOADED_LIB;

install_exec_creds(bprm);
current->flags &= ~PF_FORKNOEXEC;

set_binfmt(&flat_format);

Expand Down
1 change: 0 additions & 1 deletion fs/binfmt_som.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ load_som_binary(struct linux_binprm * bprm, struct pt_regs * regs)
goto out_free;

/* OK, This is the point of no return */
current->flags &= ~PF_FORKNOEXEC;
current->personality = PER_HPUX;
setup_new_exec(bprm);

Expand Down
2 changes: 1 addition & 1 deletion fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ int flush_old_exec(struct linux_binprm * bprm)
bprm->mm = NULL; /* We're using it now */

set_fs(USER_DS);
current->flags &= ~(PF_RANDOMIZE | PF_KTHREAD);
current->flags &= ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD);
flush_thread();
current->personality &= ~bprm->per_clear;

Expand Down

0 comments on commit 19e5109

Please sign in to comment.