diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-06-25 06:32:01 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-06-25 06:32:01 -0400 |
| commit | da7878d75b8520c9ae00d27dfbbce546a7bfdfbb (patch) | |
| tree | 547fd497a80818a60ac36831377d5df97868173c /fs/exec.c | |
| parent | 0e50a4c6ab94ffe7e5515b86b5df9e5abc8c6b13 (diff) | |
| parent | 543cf4cb3fe6f6cae3651ba918b9c56200b257d0 (diff) | |
Merge branch 'linus' into x86/pebs
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 21 |
1 files changed, 15 insertions, 6 deletions
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/file.h> | 26 | #include <linux/file.h> |
| 27 | #include <linux/fdtable.h> | 27 | #include <linux/fdtable.h> |
| 28 | #include <linux/mman.h> | 28 | #include <linux/mman.h> |
| 29 | #include <linux/a.out.h> | ||
| 30 | #include <linux/stat.h> | 29 | #include <linux/stat.h> |
| 31 | #include <linux/fcntl.h> | 30 | #include <linux/fcntl.h> |
| 32 | #include <linux/smp_lock.h> | 31 | #include <linux/smp_lock.h> |
| @@ -61,6 +60,11 @@ | |||
| 61 | #include <linux/kmod.h> | 60 | #include <linux/kmod.h> |
| 62 | #endif | 61 | #endif |
| 63 | 62 | ||
| 63 | #ifdef __alpha__ | ||
| 64 | /* for /sbin/loader handling in search_binary_handler() */ | ||
| 65 | #include <linux/a.out.h> | ||
| 66 | #endif | ||
| 67 | |||
| 64 | int core_uses_pid; | 68 | int core_uses_pid; |
| 65 | char core_pattern[CORENAME_MAX_SIZE] = "core"; | 69 | char core_pattern[CORENAME_MAX_SIZE] = "core"; |
| 66 | int suid_dumpable = 0; | 70 | int suid_dumpable = 0; |
| @@ -860,6 +864,7 @@ static int de_thread(struct task_struct *tsk) | |||
| 860 | 864 | ||
| 861 | no_thread_group: | 865 | no_thread_group: |
| 862 | exit_itimers(sig); | 866 | exit_itimers(sig); |
| 867 | flush_itimer_signals(); | ||
| 863 | if (leader) | 868 | if (leader) |
| 864 | release_task(leader); | 869 | release_task(leader); |
| 865 | 870 | ||
| @@ -1154,7 +1159,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
| 1154 | { | 1159 | { |
| 1155 | int try,retval; | 1160 | int try,retval; |
| 1156 | struct linux_binfmt *fmt; | 1161 | struct linux_binfmt *fmt; |
| 1157 | #if defined(__alpha__) && defined(CONFIG_ARCH_SUPPORTS_AOUT) | 1162 | #ifdef __alpha__ |
| 1158 | /* handle /sbin/loader.. */ | 1163 | /* handle /sbin/loader.. */ |
| 1159 | { | 1164 | { |
| 1160 | struct exec * eh = (struct exec *) bprm->buf; | 1165 | struct exec * eh = (struct exec *) bprm->buf; |
| @@ -1251,6 +1256,12 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
| 1251 | 1256 | ||
| 1252 | EXPORT_SYMBOL(search_binary_handler); | 1257 | EXPORT_SYMBOL(search_binary_handler); |
| 1253 | 1258 | ||
| 1259 | void free_bprm(struct linux_binprm *bprm) | ||
| 1260 | { | ||
| 1261 | free_arg_pages(bprm); | ||
| 1262 | kfree(bprm); | ||
| 1263 | } | ||
| 1264 | |||
| 1254 | /* | 1265 | /* |
| 1255 | * sys_execve() executes a new program. | 1266 | * sys_execve() executes a new program. |
| 1256 | */ | 1267 | */ |
| @@ -1320,17 +1331,15 @@ int do_execve(char * filename, | |||
| 1320 | retval = search_binary_handler(bprm,regs); | 1331 | retval = search_binary_handler(bprm,regs); |
| 1321 | if (retval >= 0) { | 1332 | if (retval >= 0) { |
| 1322 | /* execve success */ | 1333 | /* execve success */ |
| 1323 | free_arg_pages(bprm); | ||
| 1324 | security_bprm_free(bprm); | 1334 | security_bprm_free(bprm); |
| 1325 | acct_update_integrals(current); | 1335 | acct_update_integrals(current); |
| 1326 | kfree(bprm); | 1336 | free_bprm(bprm); |
| 1327 | if (displaced) | 1337 | if (displaced) |
| 1328 | put_files_struct(displaced); | 1338 | put_files_struct(displaced); |
| 1329 | return retval; | 1339 | return retval; |
| 1330 | } | 1340 | } |
| 1331 | 1341 | ||
| 1332 | out: | 1342 | out: |
| 1333 | free_arg_pages(bprm); | ||
| 1334 | if (bprm->security) | 1343 | if (bprm->security) |
| 1335 | security_bprm_free(bprm); | 1344 | security_bprm_free(bprm); |
| 1336 | 1345 | ||
| @@ -1344,7 +1353,7 @@ out_file: | |||
| 1344 | fput(bprm->file); | 1353 | fput(bprm->file); |
| 1345 | } | 1354 | } |
| 1346 | out_kfree: | 1355 | out_kfree: |
| 1347 | kfree(bprm); | 1356 | free_bprm(bprm); |
| 1348 | 1357 | ||
| 1349 | out_files: | 1358 | out_files: |
| 1350 | if (displaced) | 1359 | if (displaced) |
