Skip to content

Commit

Permalink
Merge branch 'exec-linus' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/ebiederm/user-namespace

Pull execve fix from Eric Biederman:
 "While working on my exec cleanups I found a bug in exec that I
  introduced by accident a couple of years ago. I apparently missed the
  fact that bprm->file can change.

  Now I have a very personal motive to clean up exec and make it more
  approachable.

  The change is just moving woud_dump to where it acts on the final
  bprm->file not the initial bprm->file. I have been careful and tested
  and verify this fix works"

* 'exec-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
  exec: Move would_dump into flush_old_exec
  • Loading branch information
Linus Torvalds committed May 17, 2020
2 parents ef0d5b9 + f87d1c9 commit b48397c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,8 @@ int flush_old_exec(struct linux_binprm * bprm)
*/
set_mm_exe_file(bprm->mm, bprm->file);

would_dump(bprm, bprm->file);

/*
* Release all of the old mmap stuff
*/
Expand Down Expand Up @@ -1876,8 +1878,6 @@ static int __do_execve_file(int fd, struct filename *filename,
if (retval < 0)
goto out;

would_dump(bprm, bprm->file);

retval = exec_binprm(bprm);
if (retval < 0)
goto out;
Expand Down

0 comments on commit b48397c

Please sign in to comment.