From 2abb96abd431838afd4b59b2c3bd19aea3109073 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Mon, 19 Mar 2012 17:03:41 +0100 Subject: [PATCH] --- yaml --- r: 289713 b: refs/heads/master c: b6e238dceed36891cc633167afe7151f1f3d83c5 h: refs/heads/master i: 289711: 4bd427f686784428869e7846ba7fe27a09ceb165 v: v3 --- [refs] | 2 +- trunk/kernel/exit.c | 14 -------------- trunk/kernel/signal.c | 9 +++++++++ 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 7066399bfc6e..1287e0e174ea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e636825346b36a07ccfc8e30946d52855e21f681 +refs/heads/master: b6e238dceed36891cc633167afe7151f1f3d83c5 diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c index 51ac4ced1313..ce5f758f40bd 100644 --- a/trunk/kernel/exit.c +++ b/trunk/kernel/exit.c @@ -818,20 +818,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 (thread_group_leader(tsk) && tsk->exit_signal != SIGCHLD && - tsk->parent_exec_id != tsk->real_parent->self_exec_id) - tsk->exit_signal = SIGCHLD; - if (unlikely(tsk->ptrace)) { int sig = thread_group_leader(tsk) && thread_group_empty(tsk) && diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c index 8511e39813c7..e76001ccf5cd 100644 --- a/trunk/kernel/signal.c +++ b/trunk/kernel/signal.c @@ -1652,6 +1652,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; /*