Skip to content

Commit 611583d

Browse files
keesgregkh
authored andcommitted
exec: Weaken dumpability for secureexec
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]>
1 parent 0d59679 commit 611583d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

fs/exec.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,9 +1350,14 @@ void setup_new_exec(struct linux_binprm * bprm)
13501350

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

1353-
/* Figure out dumpability. */
1353+
/*
1354+
* Figure out dumpability. Note that this checking only of current
1355+
* is wrong, but userspace depends on it. This should be testing
1356+
* bprm->secureexec instead.
1357+
*/
13541358
if (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP ||
1355-
bprm->secureexec)
1359+
!(uid_eq(current_euid(), current_uid()) &&
1360+
gid_eq(current_egid(), current_gid())))
13561361
set_dumpable(current->mm, suid_dumpable);
13571362
else
13581363
set_dumpable(current->mm, SUID_DUMP_USER);

0 commit comments

Comments
 (0)