Commit fe8993b3 authored by Kees Cook's avatar Kees Cook

exec: Consolidate pdeath_signal clearing

Instead of an additional secureexec check for pdeath_signal, just move it
up into the initial secureexec test. Neither perf nor arch code touches
pdeath_signal, so the relocation shouldn't change anything.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarSerge Hallyn <serge@hallyn.com>
parent 64701dee
...@@ -1351,6 +1351,9 @@ void setup_new_exec(struct linux_binprm * bprm) ...@@ -1351,6 +1351,9 @@ void setup_new_exec(struct linux_binprm * bprm)
bprm->secureexec |= bprm->cap_elevated; bprm->secureexec |= bprm->cap_elevated;
if (bprm->secureexec) { if (bprm->secureexec) {
/* Make sure parent cannot signal privileged process. */
current->pdeath_signal = 0;
/* /*
* For secureexec, reset the stack limit to sane default to * For secureexec, reset the stack limit to sane default to
* avoid bad behavior from the prior rlimits. This has to * avoid bad behavior from the prior rlimits. This has to
...@@ -1383,10 +1386,6 @@ void setup_new_exec(struct linux_binprm * bprm) ...@@ -1383,10 +1386,6 @@ void setup_new_exec(struct linux_binprm * bprm)
*/ */
current->mm->task_size = TASK_SIZE; current->mm->task_size = TASK_SIZE;
if (bprm->secureexec) {
current->pdeath_signal = 0;
}
/* An exec changes our domain. We are no longer part of the thread /* An exec changes our domain. We are no longer part of the thread
group */ group */
current->self_exec_id++; current->self_exec_id++;
......
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