Oops in exit_notify

Andreas Schwab (schwab@issan.informatik.uni-dortmund.de)
Mon, 11 Aug 97 11:11:26 +0200


When exit_notify reparents the childs of the dying process it may crash
when the original parent of a child does not currently have any children.
This can happen for example when a debugger crashes while it is attached
to a process that wasn't started by the debugger.

--- linux-2.1.48/kernel/exit.c.~2~ Wed Aug 6 20:20:16 1997
+++ linux-2.1.48/kernel/exit.c Sat Aug 9 18:27:08 1997
@@ -504,7 +504,8 @@

p->p_pptr = p->p_opptr;
p->p_osptr = p->p_pptr->p_cptr;
- p->p_osptr->p_ysptr = p;
+ if (p->p_osptr)
+ p->p_osptr->p_ysptr = p;
p->p_pptr->p_cptr = p;
if (p->state == TASK_ZOMBIE)
notify_parent(p, p->exit_signal);

-- 
Andreas Schwab                                      "And now for something
schwab@issan.informatik.uni-dortmund.de              completely different"