Merge branch 'stable-3.2' into pandora-3.2
[pandora-kernel.git] / kernel / signal.c
index b3f78d0..8f363cc 100644 (file)
@@ -1273,6 +1273,7 @@ struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
 
        return sighand;
 }
+EXPORT_SYMBOL_GPL(__lock_task_sighand);
 
 /*
  * send signal info to all the members of a group
@@ -1610,6 +1611,15 @@ bool do_notify_parent(struct task_struct *tsk, int sig)
        BUG_ON(!tsk->ptrace &&
               (tsk->group_leader != tsk || !thread_group_empty(tsk)));
 
+       if (sig != SIGCHLD) {
+               /*
+                * This is only possible if parent == real_parent.
+                * Check if it has changed security domain.
+                */
+               if (tsk->parent_exec_id != tsk->parent->self_exec_id)
+                       sig = SIGCHLD;
+       }
+
        info.si_signo = sig;
        info.si_errno = 0;
        /*
@@ -1994,8 +2004,6 @@ static bool do_signal_stop(int signr)
                 */
                if (!(sig->flags & SIGNAL_STOP_STOPPED))
                        sig->group_exit_code = signr;
-               else
-                       WARN_ON_ONCE(!current->ptrace);
 
                sig->group_stop_count = 0;