Kill some obsolete sub-thread-ptrace stuff

There is a couple of subtle checks which were needed to handle ptracing from
the same thread group. This was deprecated a long ago, imho this code just
complicates the understanding.

And, the "->parent->signal->flags & SIGNAL_GROUP_EXIT" check in exit_notify()
is not right. SIGNAL_GROUP_EXIT can mean exec(), not exit_group(). This means
ptracer can lose a ptraced zombie on exec(). Minor problem, but still the bug.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Oleg Nesterov and committed by Linus Torvalds 24728448 b6b1d877

+2 -10
+2 -6
kernel/exit.c
··· 813 813 __kill_pgrp_info(SIGCONT, SEND_SIG_PRIV, pgrp); 814 814 } 815 815 816 - /* Let father know we died 816 + /* Let father know we died 817 817 * 818 818 * Thread signals are configurable, but you aren't going to use 819 819 * that to send signals to arbitary processes. ··· 826 826 * If our self_exec id doesn't match our parent_exec_id then 827 827 * we have changed execution domain as these two values started 828 828 * the same after a fork. 829 - * 830 829 */ 831 - 832 830 if (tsk->exit_signal != SIGCHLD && tsk->exit_signal != -1 && 833 831 ( tsk->parent_exec_id != t->self_exec_id || 834 832 tsk->self_exec_id != tsk->parent_exec_id) ··· 846 848 } 847 849 848 850 state = EXIT_ZOMBIE; 849 - if (tsk->exit_signal == -1 && 850 - (likely(tsk->ptrace == 0) || 851 - unlikely(tsk->parent->signal->flags & SIGNAL_GROUP_EXIT))) 851 + if (tsk->exit_signal == -1 && likely(!tsk->ptrace)) 852 852 state = EXIT_DEAD; 853 853 tsk->exit_state = state; 854 854
-4
kernel/signal.c
··· 1561 1561 (current->ptrace & PT_ATTACHED))) 1562 1562 return 0; 1563 1563 1564 - if (unlikely(current->signal == current->parent->signal) && 1565 - unlikely(current->signal->flags & SIGNAL_GROUP_EXIT)) 1566 - return 0; 1567 - 1568 1564 /* 1569 1565 * Are we in the middle of do_coredump? 1570 1566 * If so and our tracer is also part of the coredump stopping