summaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2020-04-03 02:17:50 +0300
committerEric W. Biederman <ebiederm@xmission.com>2020-05-08 00:55:47 +0300
commit1507b7a30ad284a2a136ee79c214c0e86c62da64 (patch)
tree497978df3e8e7bfc0ac1220fa13bd846bbbb7c05 /fs/exec.c
parent89826cce37542f7950e8f4b9258284805e98430c (diff)
downloadlinux-1507b7a30ad284a2a136ee79c214c0e86c62da64.tar.xz
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: Kees Cook <keescook@chromium.org> Reviewed-by: Greg Ungerer <gerg@linux-m68k.org> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 6bd82a007bfc..71de9f57ae09 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1326,12 +1326,12 @@ int flush_old_exec(struct linux_binprm * bprm)
goto out;
/*
- * After setting bprm->called_exec_mmap (to mark that current is
- * using the prepared mm now), we have nothing left of the original
- * process. If anything from here on returns an error, the check
- * in search_binary_handler() will SEGV current.
+ * With the new mm installed it is completely impossible to
+ * fail and return to the original process. If anything from
+ * here on returns an error, the check in
+ * search_binary_handler() will SEGV current.
*/
- bprm->called_exec_mmap = 1;
+ bprm->point_of_no_return = true;
bprm->mm = NULL;
#ifdef CONFIG_POSIX_TIMERS
@@ -1720,7 +1720,7 @@ int search_binary_handler(struct linux_binprm *bprm)
read_lock(&binfmt_lock);
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 */
read_unlock(&binfmt_lock);
force_sigsegv(SIGSEGV);