WARN_ON(ptrace_event_pending(context)) is not right. If PTRACE_O_TRACEEXIT
tracee is killed it can enter ->report_exit() callback in any state.

Check signal_group_exit(). We can't trust fatal_signal_pending(), SIGKILL
can be already dequeued.

This reminds me, it is still not clear what should we actually do when the
killed tracee calls tracehook_report_exit(), but this is another story.

---

 kernel/ptrace.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- PU/kernel/ptrace.c~93_REPORT_EXIT_KILL_WARN 2009-10-15 20:34:46.000000000 
+0200
+++ PU/kernel/ptrace.c  2009-10-15 21:05:04.000000000 +0200
@@ -147,7 +147,8 @@ static u32 ptrace_report_exit(enum utrac
 {
        struct ptrace_context *context = ptrace_context(engine);
 
-       WARN_ON(ptrace_event_pending(context));
+       WARN_ON(ptrace_event_pending(context) &&
+                       !signal_group_exit(task->signal));
 
        set_stop_code(context, PTRACE_EVENT_EXIT);
        context->eventmsg = *code;

Reply via email to