diff options
author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-10-23 09:24:10 -0400 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-10-23 09:24:10 -0400 |
commit | d9214556b11a8d18ff588e60824c12041d30f791 (patch) | |
tree | 04ab59d13961675811a55c96fb12b2b167b72318 /fs/exec.c | |
parent | 72a1419a9d4c859a3345e4b83f8ef7d599d3818c (diff) | |
parent | e82c6106b04b85879d802bbbeaed30d9b10a92e2 (diff) |
Merge branches 'boards' and 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 22 |
1 files changed, 8 insertions, 14 deletions
@@ -50,15 +50,12 @@ | |||
50 | #include <linux/cn_proc.h> | 50 | #include <linux/cn_proc.h> |
51 | #include <linux/audit.h> | 51 | #include <linux/audit.h> |
52 | #include <linux/tracehook.h> | 52 | #include <linux/tracehook.h> |
53 | #include <linux/kmod.h> | ||
53 | 54 | ||
54 | #include <asm/uaccess.h> | 55 | #include <asm/uaccess.h> |
55 | #include <asm/mmu_context.h> | 56 | #include <asm/mmu_context.h> |
56 | #include <asm/tlb.h> | 57 | #include <asm/tlb.h> |
57 | 58 | ||
58 | #ifdef CONFIG_KMOD | ||
59 | #include <linux/kmod.h> | ||
60 | #endif | ||
61 | |||
62 | #ifdef __alpha__ | 59 | #ifdef __alpha__ |
63 | /* for /sbin/loader handling in search_binary_handler() */ | 60 | /* for /sbin/loader handling in search_binary_handler() */ |
64 | #include <linux/a.out.h> | 61 | #include <linux/a.out.h> |
@@ -391,7 +388,7 @@ static int count(char __user * __user * argv, int max) | |||
391 | if (!p) | 388 | if (!p) |
392 | break; | 389 | break; |
393 | argv++; | 390 | argv++; |
394 | if(++i > max) | 391 | if (i++ >= max) |
395 | return -E2BIG; | 392 | return -E2BIG; |
396 | cond_resched(); | 393 | cond_resched(); |
397 | } | 394 | } |
@@ -825,8 +822,6 @@ static int de_thread(struct task_struct *tsk) | |||
825 | schedule(); | 822 | schedule(); |
826 | } | 823 | } |
827 | 824 | ||
828 | if (unlikely(task_child_reaper(tsk) == leader)) | ||
829 | task_active_pid_ns(tsk)->child_reaper = tsk; | ||
830 | /* | 825 | /* |
831 | * The only record we have of the real-time age of a | 826 | * The only record we have of the real-time age of a |
832 | * process, regardless of execs it's done, is start_time. | 827 | * process, regardless of execs it's done, is start_time. |
@@ -1189,7 +1184,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
1189 | return retval; | 1184 | return retval; |
1190 | 1185 | ||
1191 | /* Remember if the application is TASO. */ | 1186 | /* Remember if the application is TASO. */ |
1192 | bprm->sh_bang = eh->ah.entry < 0x100000000UL; | 1187 | bprm->taso = eh->ah.entry < 0x100000000UL; |
1193 | 1188 | ||
1194 | bprm->file = file; | 1189 | bprm->file = file; |
1195 | bprm->loader = loader; | 1190 | bprm->loader = loader; |
@@ -1247,8 +1242,8 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
1247 | read_unlock(&binfmt_lock); | 1242 | read_unlock(&binfmt_lock); |
1248 | if (retval != -ENOEXEC || bprm->mm == NULL) { | 1243 | if (retval != -ENOEXEC || bprm->mm == NULL) { |
1249 | break; | 1244 | break; |
1250 | #ifdef CONFIG_KMOD | 1245 | #ifdef CONFIG_MODULES |
1251 | }else{ | 1246 | } else { |
1252 | #define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e)) | 1247 | #define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e)) |
1253 | if (printable(bprm->buf[0]) && | 1248 | if (printable(bprm->buf[0]) && |
1254 | printable(bprm->buf[1]) && | 1249 | printable(bprm->buf[1]) && |
@@ -1391,7 +1386,7 @@ EXPORT_SYMBOL(set_binfmt); | |||
1391 | * name into corename, which must have space for at least | 1386 | * name into corename, which must have space for at least |
1392 | * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. | 1387 | * CORENAME_MAX_SIZE bytes plus one byte for the zero terminator. |
1393 | */ | 1388 | */ |
1394 | static int format_corename(char *corename, int nr_threads, long signr) | 1389 | static int format_corename(char *corename, long signr) |
1395 | { | 1390 | { |
1396 | const char *pat_ptr = core_pattern; | 1391 | const char *pat_ptr = core_pattern; |
1397 | int ispipe = (*pat_ptr == '|'); | 1392 | int ispipe = (*pat_ptr == '|'); |
@@ -1498,8 +1493,7 @@ static int format_corename(char *corename, int nr_threads, long signr) | |||
1498 | * If core_pattern does not include a %p (as is the default) | 1493 | * If core_pattern does not include a %p (as is the default) |
1499 | * and core_uses_pid is set, then .%pid will be appended to | 1494 | * and core_uses_pid is set, then .%pid will be appended to |
1500 | * the filename. Do not do this for piped commands. */ | 1495 | * the filename. Do not do this for piped commands. */ |
1501 | if (!ispipe && !pid_in_pattern | 1496 | if (!ispipe && !pid_in_pattern && core_uses_pid) { |
1502 | && (core_uses_pid || nr_threads)) { | ||
1503 | rc = snprintf(out_ptr, out_end - out_ptr, | 1497 | rc = snprintf(out_ptr, out_end - out_ptr, |
1504 | ".%d", task_tgid_vnr(current)); | 1498 | ".%d", task_tgid_vnr(current)); |
1505 | if (rc > out_end - out_ptr) | 1499 | if (rc > out_end - out_ptr) |
@@ -1762,7 +1756,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
1762 | * uses lock_kernel() | 1756 | * uses lock_kernel() |
1763 | */ | 1757 | */ |
1764 | lock_kernel(); | 1758 | lock_kernel(); |
1765 | ispipe = format_corename(corename, retval, signr); | 1759 | ispipe = format_corename(corename, signr); |
1766 | unlock_kernel(); | 1760 | unlock_kernel(); |
1767 | /* | 1761 | /* |
1768 | * Don't bother to check the RLIMIT_CORE value if core_pattern points | 1762 | * Don't bother to check the RLIMIT_CORE value if core_pattern points |