exec: Rename flush_old_exec begin_new_exec

There is and has been for a very long time been a lot more going on in
flush_old_exec than just flushing the old state.  After the movement
of code from setup_new_exec there is a whole lot more going on than
just flushing the old executables state.

Rename flush_old_exec to begin_new_exec to more accurately reflect
what this function does.

Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
Eric W. Biederman
2020-05-03 07:54:10 -05:00
parent df9e4d2c4a
commit 2388777a0a
8 changed files with 9 additions and 9 deletions

View File

@@ -1524,7 +1524,7 @@ display-graph option::
=> remove_vma => remove_vma
=> exit_mmap => exit_mmap
=> mmput => mmput
=> flush_old_exec => begin_new_exec
=> load_elf_binary => load_elf_binary
=> search_binary_handler => search_binary_handler
=> __do_execve_file.isra.32 => __do_execve_file.isra.32

View File

@@ -131,7 +131,7 @@ static int load_aout_binary(struct linux_binprm *bprm)
return -ENOMEM; return -ENOMEM;
/* Flush all traces of the currently running executable */ /* Flush all traces of the currently running executable */
retval = flush_old_exec(bprm); retval = begin_new_exec(bprm);
if (retval) if (retval)
return retval; return retval;

View File

@@ -151,7 +151,7 @@ static int load_aout_binary(struct linux_binprm * bprm)
return -ENOMEM; return -ENOMEM;
/* Flush all traces of the currently running executable */ /* Flush all traces of the currently running executable */
retval = flush_old_exec(bprm); retval = begin_new_exec(bprm);
if (retval) if (retval)
return retval; return retval;

View File

@@ -844,7 +844,7 @@ out_free_interp:
goto out_free_dentry; goto out_free_dentry;
/* Flush all traces of the currently running executable */ /* Flush all traces of the currently running executable */
retval = flush_old_exec(bprm); retval = begin_new_exec(bprm);
if (retval) if (retval)
goto out_free_dentry; goto out_free_dentry;

View File

@@ -338,7 +338,7 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm)
interp_params.flags |= ELF_FDPIC_FLAG_CONSTDISP; interp_params.flags |= ELF_FDPIC_FLAG_CONSTDISP;
/* flush all traces of the currently running executable */ /* flush all traces of the currently running executable */
retval = flush_old_exec(bprm); retval = begin_new_exec(bprm);
if (retval) if (retval)
goto error; goto error;

View File

@@ -534,7 +534,7 @@ static int load_flat_file(struct linux_binprm *bprm,
/* Flush all traces of the currently running executable */ /* Flush all traces of the currently running executable */
if (id == 0) { if (id == 0) {
ret = flush_old_exec(bprm); ret = begin_new_exec(bprm);
if (ret) if (ret)
goto err; goto err;

View File

@@ -1298,7 +1298,7 @@ void __set_task_comm(struct task_struct *tsk, const char *buf, bool exec)
* signal (via de_thread() or coredump), or will have SEGV raised * signal (via de_thread() or coredump), or will have SEGV raised
* (after exec_mmap()) by search_binary_handlers (see below). * (after exec_mmap()) by search_binary_handlers (see below).
*/ */
int flush_old_exec(struct linux_binprm * bprm) int begin_new_exec(struct linux_binprm * bprm)
{ {
struct task_struct *me = current; struct task_struct *me = current;
int retval; int retval;
@@ -1433,7 +1433,7 @@ out_unlock:
out: out:
return retval; return retval;
} }
EXPORT_SYMBOL(flush_old_exec); EXPORT_SYMBOL(begin_new_exec);
void would_dump(struct linux_binprm *bprm, struct file *file) void would_dump(struct linux_binprm *bprm, struct file *file)
{ {

View File

@@ -125,7 +125,7 @@ extern void unregister_binfmt(struct linux_binfmt *);
extern int prepare_binprm(struct linux_binprm *); extern int prepare_binprm(struct linux_binprm *);
extern int __must_check remove_arg_zero(struct linux_binprm *); extern int __must_check remove_arg_zero(struct linux_binprm *);
extern int search_binary_handler(struct linux_binprm *); extern int search_binary_handler(struct linux_binprm *);
extern int flush_old_exec(struct linux_binprm * bprm); extern int begin_new_exec(struct linux_binprm * bprm);
extern void setup_new_exec(struct linux_binprm * bprm); extern void setup_new_exec(struct linux_binprm * bprm);
extern void finalize_exec(struct linux_binprm *bprm); extern void finalize_exec(struct linux_binprm *bprm);
extern void would_dump(struct linux_binprm *, struct file *); extern void would_dump(struct linux_binprm *, struct file *);