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, 6 insertions, 17 deletions
diff --git a/fs/exec.c b/fs/exec.c
index b152029f18f6..9f9f931ef949 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -735,6 +735,7 @@ static int exec_mmap(struct mm_struct *mm)
735 tsk->active_mm = mm; 735 tsk->active_mm = mm;
736 activate_mm(active_mm, mm); 736 activate_mm(active_mm, mm);
737 task_unlock(tsk); 737 task_unlock(tsk);
738 mm_update_next_owner(mm);
738 arch_pick_mmap_layout(mm); 739 arch_pick_mmap_layout(mm);
739 if (old_mm) { 740 if (old_mm) {
740 up_read(&old_mm->mmap_sem); 741 up_read(&old_mm->mmap_sem);
@@ -765,9 +766,7 @@ static int de_thread(struct task_struct *tsk)
765 766
766 /* 767 /*
767 * Kill all other threads in the thread group. 768 * Kill all other threads in the thread group.
768 * We must hold tasklist_lock to call zap_other_threads.
769 */ 769 */
770 read_lock(&tasklist_lock);
771 spin_lock_irq(lock); 770 spin_lock_irq(lock);
772 if (signal_group_exit(sig)) { 771 if (signal_group_exit(sig)) {
773 /* 772 /*
@@ -775,21 +774,10 @@ static int de_thread(struct task_struct *tsk)
775 * return so that the signal is processed. 774 * return so that the signal is processed.
776 */ 775 */
777 spin_unlock_irq(lock); 776 spin_unlock_irq(lock);
778 read_unlock(&tasklist_lock);
779 return -EAGAIN; 777 return -EAGAIN;
780 } 778 }
781
782 /*
783 * child_reaper ignores SIGKILL, change it now.
784 * Reparenting needs write_lock on tasklist_lock,
785 * so it is safe to do it under read_lock.
786 */
787 if (unlikely(tsk->group_leader == task_child_reaper(tsk)))
788 task_active_pid_ns(tsk)->child_reaper = tsk;
789
790 sig->group_exit_task = tsk; 779 sig->group_exit_task = tsk;
791 zap_other_threads(tsk); 780 zap_other_threads(tsk);
792 read_unlock(&tasklist_lock);
793 781
794 /* Account for the thread group leader hanging around: */ 782 /* Account for the thread group leader hanging around: */
795 count = thread_group_leader(tsk) ? 1 : 2; 783 count = thread_group_leader(tsk) ? 1 : 2;
@@ -810,7 +798,7 @@ static int de_thread(struct task_struct *tsk)
810 if (!thread_group_leader(tsk)) { 798 if (!thread_group_leader(tsk)) {
811 leader = tsk->group_leader; 799 leader = tsk->group_leader;
812 800
813 sig->notify_count = -1; 801 sig->notify_count = -1; /* for exit_notify() */
814 for (;;) { 802 for (;;) {
815 write_lock_irq(&tasklist_lock); 803 write_lock_irq(&tasklist_lock);
816 if (likely(leader->exit_state)) 804 if (likely(leader->exit_state))
@@ -820,6 +808,8 @@ static int de_thread(struct task_struct *tsk)
820 schedule(); 808 schedule();
821 } 809 }
822 810
811 if (unlikely(task_child_reaper(tsk) == leader))
812 task_active_pid_ns(tsk)->child_reaper = tsk;
823 /* 813 /*
824 * The only record we have of the real-time age of a 814 * The only record we have of the real-time age of a
825 * process, regardless of execs it's done, is start_time. 815 * process, regardless of execs it's done, is start_time.
@@ -963,6 +953,8 @@ int flush_old_exec(struct linux_binprm * bprm)
963 if (retval) 953 if (retval)
964 goto out; 954 goto out;
965 955
956 set_mm_exe_file(bprm->mm, bprm->file);
957
966 /* 958 /*
967 * Release all of the old mmap stuff 959 * Release all of the old mmap stuff
968 */ 960 */
@@ -1268,7 +1260,6 @@ int do_execve(char * filename,
1268{ 1260{
1269 struct linux_binprm *bprm; 1261 struct linux_binprm *bprm;
1270 struct file *file; 1262 struct file *file;
1271 unsigned long env_p;
1272 struct files_struct *displaced; 1263 struct files_struct *displaced;
1273 int retval; 1264 int retval;
1274 1265
@@ -1321,11 +1312,9 @@ int do_execve(char * filename,
1321 if (retval < 0) 1312 if (retval < 0)
1322 goto out; 1313 goto out;
1323 1314
1324 env_p = bprm->p;
1325 retval = copy_strings(bprm->argc, argv, bprm); 1315 retval = copy_strings(bprm->argc, argv, bprm);
1326 if (retval < 0) 1316 if (retval < 0)
1327 goto out; 1317 goto out;
1328 bprm->argv_len = env_p - bprm->p;
1329 1318
1330 retval = search_binary_handler(bprm,regs); 1319 retval = search_binary_handler(bprm,regs);
1331 if (retval >= 0) { 1320 if (retval >= 0) {