Skip to content

Commit

Permalink
[PATCH] fix non-leader exec under ptrace
Browse files Browse the repository at this point in the history
This reverts most of commit 30e0fca.
It broke the case of non-leader MT exec when ptraced.
I think the bug it was intended to fix was already addressed by commit
788e05a.

Signed-off-by: Roland McGrath <roland@redhat.com>
Acked-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Roland McGrath authored and Linus Torvalds committed Apr 14, 2006
1 parent c06511d commit e57a505
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ void ptrace_untrace(task_t *child)
signal_wake_up(child, 1);
}
}
if (child->signal->flags & SIGNAL_GROUP_EXIT) {
sigaddset(&child->pending.signal, SIGKILL);
signal_wake_up(child, 1);
}
spin_unlock(&child->sighand->siglock);
}

Expand All @@ -81,7 +77,8 @@ void __ptrace_unlink(task_t *child)
add_parent(child);
}

ptrace_untrace(child);
if (child->state == TASK_TRACED)
ptrace_untrace(child);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1754,9 +1754,9 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
/* Let the debugger run. */
ptrace_stop(signr, signr, info);

/* We're back. Did the debugger cancel the sig or group_exit? */
/* We're back. Did the debugger cancel the sig? */
signr = current->exit_code;
if (signr == 0 || current->signal->flags & SIGNAL_GROUP_EXIT)
if (signr == 0)
continue;

current->exit_code = 0;
Expand Down

0 comments on commit e57a505

Please sign in to comment.