diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/exec.c | 16 |
1 files changed, 9 insertions, 7 deletions
| @@ -1135,13 +1135,6 @@ void setup_new_exec(struct linux_binprm * bprm) | |||
| 1135 | set_dumpable(current->mm, suid_dumpable); | 1135 | set_dumpable(current->mm, suid_dumpable); |
| 1136 | } | 1136 | } |
| 1137 | 1137 | ||
| 1138 | /* | ||
| 1139 | * Flush performance counters when crossing a | ||
| 1140 | * security domain: | ||
| 1141 | */ | ||
| 1142 | if (!get_dumpable(current->mm)) | ||
| 1143 | perf_event_exit_task(current); | ||
| 1144 | |||
| 1145 | /* An exec changes our domain. We are no longer part of the thread | 1138 | /* An exec changes our domain. We are no longer part of the thread |
| 1146 | group */ | 1139 | group */ |
| 1147 | 1140 | ||
| @@ -1205,6 +1198,15 @@ void install_exec_creds(struct linux_binprm *bprm) | |||
| 1205 | 1198 | ||
| 1206 | commit_creds(bprm->cred); | 1199 | commit_creds(bprm->cred); |
| 1207 | bprm->cred = NULL; | 1200 | bprm->cred = NULL; |
| 1201 | |||
| 1202 | /* | ||
| 1203 | * Disable monitoring for regular users | ||
| 1204 | * when executing setuid binaries. Must | ||
| 1205 | * wait until new credentials are committed | ||
| 1206 | * by commit_creds() above | ||
| 1207 | */ | ||
| 1208 | if (get_dumpable(current->mm) != SUID_DUMP_USER) | ||
| 1209 | perf_event_exit_task(current); | ||
| 1208 | /* | 1210 | /* |
| 1209 | * cred_guard_mutex must be held at least to this point to prevent | 1211 | * cred_guard_mutex must be held at least to this point to prevent |
| 1210 | * ptrace_attach() from altering our determination of the task's | 1212 | * ptrace_attach() from altering our determination of the task's |
