Commit 6e2c9568 authored by Roland McGrath's avatar Roland McGrath Committed by Linus Torvalds

[PATCH] don't let PTRACE_EVENT_EXIT stop hold up SIGKILL

When a thread stops for ptrace exit tracing, it cannot be resumed by
SIGKILL.  Once PF_EXITING is set, SIGKILL will not cause a wakeup from stop
(see wants_signal in kernel/signal.c).  This patch moves the ptrace stop
for exit tracing before the setting of PF_EXITING.
Signed-off-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4c2e8e62
......@@ -790,6 +790,12 @@ fastcall NORET_TYPE void do_exit(long code)
panic("Attempted to kill init!");
if (tsk->io_context)
exit_io_context();
if (unlikely(current->ptrace & PT_TRACE_EXIT)) {
current->ptrace_message = code;
ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP);
}
tsk->flags |= PF_EXITING;
del_timer_sync(&tsk->real_timer);
......@@ -798,11 +804,6 @@ fastcall NORET_TYPE void do_exit(long code)
current->comm, current->pid,
preempt_count());
if (unlikely(current->ptrace & PT_TRACE_EXIT)) {
current->ptrace_message = code;
ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP);
}
acct_update_integrals();
update_mem_hiwater();
group_dead = atomic_dec_and_test(&tsk->signal->live);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment