diff options
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -1084,9 +1084,12 @@ int flush_old_exec(struct linux_binprm * bprm) | |||
1084 | */ | 1084 | */ |
1085 | current->mm->task_size = TASK_SIZE; | 1085 | current->mm->task_size = TASK_SIZE; |
1086 | 1086 | ||
1087 | if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || | 1087 | if (bprm->e_uid != current->euid || bprm->e_gid != current->egid) { |
1088 | file_permission(bprm->file, MAY_READ) || | 1088 | suid_keys(current); |
1089 | (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) { | 1089 | set_dumpable(current->mm, suid_dumpable); |
1090 | current->pdeath_signal = 0; | ||
1091 | } else if (file_permission(bprm->file, MAY_READ) || | ||
1092 | (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP)) { | ||
1090 | suid_keys(current); | 1093 | suid_keys(current); |
1091 | set_dumpable(current->mm, suid_dumpable); | 1094 | set_dumpable(current->mm, suid_dumpable); |
1092 | } | 1095 | } |
@@ -1177,8 +1180,10 @@ void compute_creds(struct linux_binprm *bprm) | |||
1177 | { | 1180 | { |
1178 | int unsafe; | 1181 | int unsafe; |
1179 | 1182 | ||
1180 | if (bprm->e_uid != current->uid) | 1183 | if (bprm->e_uid != current->uid) { |
1181 | suid_keys(current); | 1184 | suid_keys(current); |
1185 | current->pdeath_signal = 0; | ||
1186 | } | ||
1182 | exec_keys(current); | 1187 | exec_keys(current); |
1183 | 1188 | ||
1184 | task_lock(current); | 1189 | task_lock(current); |