Commit 1507b7a3 authored by Eric W. Biederman's avatar Eric W. Biederman

exec: Rename the flag called_exec_mmap point_of_no_return

Update the comments and make the code easier to understand by
renaming this flag.
Reviewed-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 89826cce
...@@ -1326,12 +1326,12 @@ int flush_old_exec(struct linux_binprm * bprm) ...@@ -1326,12 +1326,12 @@ int flush_old_exec(struct linux_binprm * bprm)
goto out; goto out;
/* /*
* After setting bprm->called_exec_mmap (to mark that current is * With the new mm installed it is completely impossible to
* using the prepared mm now), we have nothing left of the original * fail and return to the original process. If anything from
* process. If anything from here on returns an error, the check * here on returns an error, the check in
* in search_binary_handler() will SEGV current. * search_binary_handler() will SEGV current.
*/ */
bprm->called_exec_mmap = 1; bprm->point_of_no_return = true;
bprm->mm = NULL; bprm->mm = NULL;
#ifdef CONFIG_POSIX_TIMERS #ifdef CONFIG_POSIX_TIMERS
...@@ -1720,7 +1720,7 @@ int search_binary_handler(struct linux_binprm *bprm) ...@@ -1720,7 +1720,7 @@ int search_binary_handler(struct linux_binprm *bprm)
read_lock(&binfmt_lock); read_lock(&binfmt_lock);
put_binfmt(fmt); put_binfmt(fmt);
if (retval < 0 && bprm->called_exec_mmap) { if (retval < 0 && bprm->point_of_no_return) {
/* we got to flush_old_exec() and failed after it */ /* we got to flush_old_exec() and failed after it */
read_unlock(&binfmt_lock); read_unlock(&binfmt_lock);
force_sigsegv(SIGSEGV); force_sigsegv(SIGSEGV);
......
...@@ -46,10 +46,10 @@ struct linux_binprm { ...@@ -46,10 +46,10 @@ struct linux_binprm {
*/ */
secureexec:1, secureexec:1,
/* /*
* Set by flush_old_exec, when exec_mmap has been called. * Set when errors can no longer be returned to the
* This is past the point of no return. * original userspace.
*/ */
called_exec_mmap:1; point_of_no_return:1;
#ifdef __alpha__ #ifdef __alpha__
unsigned int taso:1; unsigned int taso:1;
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment