Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / kernel / exit.c
index d0b7d98..0eca2ef 100644 (file)
@@ -499,6 +499,7 @@ struct files_struct *get_files_struct(struct task_struct *task)
 
        return files;
 }
+EXPORT_SYMBOL_GPL(get_files_struct);
 
 void put_files_struct(struct files_struct *files)
 {
@@ -520,6 +521,7 @@ void put_files_struct(struct files_struct *files)
                rcu_read_unlock();
        }
 }
+EXPORT_SYMBOL_GPL(put_files_struct);
 
 void reset_files_struct(struct files_struct *files)
 {
@@ -819,25 +821,6 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
        if (group_dead)
                kill_orphaned_pgrp(tsk->group_leader, NULL);
 
-       /* Let father know we died
-        *
-        * Thread signals are configurable, but you aren't going to use
-        * that to send signals to arbitrary processes.
-        * That stops right now.
-        *
-        * If the parent exec id doesn't match the exec id we saved
-        * when we started then we know the parent has changed security
-        * domain.
-        *
-        * If our self_exec id doesn't match our parent_exec_id then
-        * we have changed execution domain as these two values started
-        * the same after a fork.
-        */
-       if (thread_group_leader(tsk) && tsk->exit_signal != SIGCHLD &&
-           (tsk->parent_exec_id != tsk->real_parent->self_exec_id ||
-            tsk->self_exec_id != tsk->parent_exec_id))
-               tsk->exit_signal = SIGCHLD;
-
        if (unlikely(tsk->ptrace)) {
                int sig = thread_group_leader(tsk) &&
                                thread_group_empty(tsk) &&
@@ -1540,8 +1523,15 @@ static int wait_consider_task(struct wait_opts *wo, int ptrace,
        }
 
        /* dead body doesn't have much to contribute */
-       if (p->exit_state == EXIT_DEAD)
+       if (unlikely(p->exit_state == EXIT_DEAD)) {
+               /*
+                * But do not ignore this task until the tracer does
+                * wait_task_zombie()->do_notify_parent().
+                */
+               if (likely(!ptrace) && unlikely(ptrace_reparented(p)))
+                       wo->notask_error = 0;
                return 0;
+       }
 
        /* slay zombie? */
        if (p->exit_state == EXIT_ZOMBIE) {