aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 1f8a24aa1f8b..fd9234379e8d 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -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
64int core_uses_pid; 68int core_uses_pid;
65char core_pattern[CORENAME_MAX_SIZE] = "core"; 69char core_pattern[CORENAME_MAX_SIZE] = "core";
66int suid_dumpable = 0; 70int suid_dumpable = 0;
@@ -606,7 +610,7 @@ int setup_arg_pages(struct linux_binprm *bprm,
606 bprm->exec -= stack_shift; 610 bprm->exec -= stack_shift;
607 611
608 down_write(&mm->mmap_sem); 612 down_write(&mm->mmap_sem);
609 vm_flags = vma->vm_flags; 613 vm_flags = VM_STACK_FLAGS;
610 614
611 /* 615 /*
612 * Adjust stack execute permissions; explicitly enable for 616 * Adjust stack execute permissions; explicitly enable for
@@ -860,6 +864,7 @@ static int de_thread(struct task_struct *tsk)
860 864
861no_thread_group: 865no_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
1252EXPORT_SYMBOL(search_binary_handler); 1257EXPORT_SYMBOL(search_binary_handler);
1253 1258
1259void 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
1332out: 1342out:
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 }
1346out_kfree: 1355out_kfree:
1347 kfree(bprm); 1356 free_bprm(bprm);
1348 1357
1349out_files: 1358out_files:
1350 if (displaced) 1359 if (displaced)