diff options
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -48,6 +48,7 @@ | |||
48 | #include <linux/syscalls.h> | 48 | #include <linux/syscalls.h> |
49 | #include <linux/rmap.h> | 49 | #include <linux/rmap.h> |
50 | #include <linux/acct.h> | 50 | #include <linux/acct.h> |
51 | #include <linux/cn_proc.h> | ||
51 | 52 | ||
52 | #include <asm/uaccess.h> | 53 | #include <asm/uaccess.h> |
53 | #include <asm/mmu_context.h> | 54 | #include <asm/mmu_context.h> |
@@ -589,6 +590,7 @@ static inline int de_thread(struct task_struct *tsk) | |||
589 | struct signal_struct *sig = tsk->signal; | 590 | struct signal_struct *sig = tsk->signal; |
590 | struct sighand_struct *newsighand, *oldsighand = tsk->sighand; | 591 | struct sighand_struct *newsighand, *oldsighand = tsk->sighand; |
591 | spinlock_t *lock = &oldsighand->siglock; | 592 | spinlock_t *lock = &oldsighand->siglock; |
593 | struct task_struct *leader = NULL; | ||
592 | int count; | 594 | int count; |
593 | 595 | ||
594 | /* | 596 | /* |
@@ -664,7 +666,7 @@ static inline int de_thread(struct task_struct *tsk) | |||
664 | * and to assume its PID: | 666 | * and to assume its PID: |
665 | */ | 667 | */ |
666 | if (!thread_group_leader(current)) { | 668 | if (!thread_group_leader(current)) { |
667 | struct task_struct *leader = current->group_leader, *parent; | 669 | struct task_struct *parent; |
668 | struct dentry *proc_dentry1, *proc_dentry2; | 670 | struct dentry *proc_dentry1, *proc_dentry2; |
669 | unsigned long exit_state, ptrace; | 671 | unsigned long exit_state, ptrace; |
670 | 672 | ||
@@ -673,6 +675,7 @@ static inline int de_thread(struct task_struct *tsk) | |||
673 | * It should already be zombie at this point, most | 675 | * It should already be zombie at this point, most |
674 | * of the time. | 676 | * of the time. |
675 | */ | 677 | */ |
678 | leader = current->group_leader; | ||
676 | while (leader->exit_state != EXIT_ZOMBIE) | 679 | while (leader->exit_state != EXIT_ZOMBIE) |
677 | yield(); | 680 | yield(); |
678 | 681 | ||
@@ -732,7 +735,6 @@ static inline int de_thread(struct task_struct *tsk) | |||
732 | proc_pid_flush(proc_dentry2); | 735 | proc_pid_flush(proc_dentry2); |
733 | 736 | ||
734 | BUG_ON(exit_state != EXIT_ZOMBIE); | 737 | BUG_ON(exit_state != EXIT_ZOMBIE); |
735 | release_task(leader); | ||
736 | } | 738 | } |
737 | 739 | ||
738 | /* | 740 | /* |
@@ -742,8 +744,11 @@ static inline int de_thread(struct task_struct *tsk) | |||
742 | sig->flags = 0; | 744 | sig->flags = 0; |
743 | 745 | ||
744 | no_thread_group: | 746 | no_thread_group: |
745 | BUG_ON(atomic_read(&sig->count) != 1); | ||
746 | exit_itimers(sig); | 747 | exit_itimers(sig); |
748 | if (leader) | ||
749 | release_task(leader); | ||
750 | |||
751 | BUG_ON(atomic_read(&sig->count) != 1); | ||
747 | 752 | ||
748 | if (atomic_read(&oldsighand->count) == 1) { | 753 | if (atomic_read(&oldsighand->count) == 1) { |
749 | /* | 754 | /* |
@@ -1096,6 +1101,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) | |||
1096 | fput(bprm->file); | 1101 | fput(bprm->file); |
1097 | bprm->file = NULL; | 1102 | bprm->file = NULL; |
1098 | current->did_exec = 1; | 1103 | current->did_exec = 1; |
1104 | proc_exec_connector(current); | ||
1099 | return retval; | 1105 | return retval; |
1100 | } | 1106 | } |
1101 | read_lock(&binfmt_lock); | 1107 | read_lock(&binfmt_lock); |
@@ -1509,7 +1515,7 @@ int do_coredump(long signr, int exit_code, struct pt_regs * regs) | |||
1509 | goto close_fail; | 1515 | goto close_fail; |
1510 | if (!file->f_op->write) | 1516 | if (!file->f_op->write) |
1511 | goto close_fail; | 1517 | goto close_fail; |
1512 | if (do_truncate(file->f_dentry, 0) != 0) | 1518 | if (do_truncate(file->f_dentry, 0, file) != 0) |
1513 | goto close_fail; | 1519 | goto close_fail; |
1514 | 1520 | ||
1515 | retval = binfmt->core_dump(signr, regs, file); | 1521 | retval = binfmt->core_dump(signr, regs, file); |