Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24728448 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

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: default avatarOleg Nesterov <oleg@tv-sign.ru>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b6b1d877
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -826,9 +826,7 @@ static void exit_notify(struct task_struct *tsk)
	 * 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 (tsk->exit_signal != SIGCHLD && tsk->exit_signal != -1 &&
	    ( tsk->parent_exec_id != t->self_exec_id  ||
	      tsk->self_exec_id != tsk->parent_exec_id)
@@ -848,9 +846,7 @@ static void exit_notify(struct task_struct *tsk)
	}

	state = EXIT_ZOMBIE;
	if (tsk->exit_signal == -1 &&
	    (likely(tsk->ptrace == 0) ||
	     unlikely(tsk->parent->signal->flags & SIGNAL_GROUP_EXIT)))
	if (tsk->exit_signal == -1 && likely(!tsk->ptrace))
		state = EXIT_DEAD;
	tsk->exit_state = state;

+0 −4
Original line number Diff line number Diff line
@@ -1561,10 +1561,6 @@ static inline int may_ptrace_stop(void)
		    (current->ptrace & PT_ATTACHED)))
		return 0;

	if (unlikely(current->signal == current->parent->signal) &&
	    unlikely(current->signal->flags & SIGNAL_GROUP_EXIT))
		return 0;

	/*
	 * Are we in the middle of do_coredump?
	 * If so and our tracer is also part of the coredump stopping