Skip to content

Commit

Permalink
exec: Weaken dumpability for secureexec
Browse files Browse the repository at this point in the history
commit e816c20 upstream.

This is a logical revert of commit e37fdb7 ("exec: Use secureexec
for setting dumpability")

This weakens dumpability back to checking only for uid/gid changes in
current (which is useless), but userspace depends on dumpability not
being tied to secureexec.

  https://bugzilla.redhat.com/show_bug.cgi?id=1528633

Reported-by: Tom Horsley <[email protected]>
Fixes: e37fdb7 ("exec: Use secureexec for setting dumpability")
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
kees authored and gregkh committed Jan 5, 2018
1 parent 0d59679 commit 611583d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,9 +1350,14 @@ void setup_new_exec(struct linux_binprm * bprm)

current->sas_ss_sp = current->sas_ss_size = 0;

/* Figure out dumpability. */
/*
* Figure out dumpability. Note that this checking only of current
* is wrong, but userspace depends on it. This should be testing
* bprm->secureexec instead.
*/
if (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP ||
bprm->secureexec)
!(uid_eq(current_euid(), current_uid()) &&
gid_eq(current_egid(), current_gid())))
set_dumpable(current->mm, suid_dumpable);
else
set_dumpable(current->mm, SUID_DUMP_USER);
Expand Down

0 comments on commit 611583d

Please sign in to comment.