Re: [PATCH 2/2] ptrace children revamp

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Oleg Nesterov
Date: Saturday, April 5, 2008 - 7:06 am

On 04/04, Roland McGrath wrote:

Heh. You are right, the current kernel has the same (minor) bug.
I beleive it was introduced by b2b2cbc4b2a2f389442549399a993a8306420baf.
Before this patch we notified the new parent even if it is from the same
thread group. If SIGCHLD is ignored, do_notify_parent() sets ->exit_signal = -1,
and then forget_original_parent() notices this and adds the child to ptrace_dead.
Now we don't notify the parent, and so the child "hangs".


However, now I think your patch adds a more serious problem, we can really
leak a zombie. Suppose that that we are ->real_parent, the child was traced
by us, it is zombie now, and the child is not a group leader. No matter who
is the new parent, no matter what is the state of SIGCHLD, we must not reparent
the child: nobody can release it except us. It is not traced any longer,
its ->exit_signal == -1, eligible_child() doesn't like this.

No?


Well, I was thinking about another thread (the new parent) sleeping in
do_wait(__WNOTHREAD)... not sure this really matters, though.

But,


Yes, I missed this. The second signal doesn't look right.


Yes, yes, I agree. I just wanted to be sure you didn't miss this bug.

Oleg.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/2] do_wait reorganization, Roland McGrath, (Fri Mar 28, 8:34 pm)
[PATCH 2/2] ptrace children revamp, Roland McGrath, (Fri Mar 28, 8:35 pm)
Re: [PATCH 1/2] do_wait reorganization, Oleg Nesterov, (Sat Mar 29, 3:35 am)
Re: [PATCH 2/2] ptrace children revamp, Oleg Nesterov, (Sat Mar 29, 3:39 am)
Re: [PATCH 2/2] ptrace children revamp, Oleg Nesterov, (Sat Mar 29, 6:10 am)
Re: [PATCH 2/2] ptrace children revamp, Oleg Nesterov, (Sat Mar 29, 7:37 am)
Re: [PATCH 1/2] do_wait reorganization, Linus Torvalds, (Sat Mar 29, 9:16 am)
Re: [PATCH 1/2] do_wait reorganization, Roland McGrath, (Sun Mar 30, 8:27 pm)
Re: [PATCH 1/2] do_wait reorganization, Roland McGrath, (Sun Mar 30, 8:54 pm)
[PATCH 1/3] do_wait reorganization, Roland McGrath, (Sun Mar 30, 8:57 pm)
[PATCH 2/3] ptrace children revamp, Roland McGrath, (Sun Mar 30, 8:59 pm)
Re: [PATCH 1/3] do_wait reorganization, Oleg Nesterov, (Mon Mar 31, 1:51 am)
Re: [PATCH 2/3] ptrace children revamp, Oleg Nesterov, (Mon Mar 31, 2:12 am)
Re: [PATCH 1/3] do_wait reorganization, Oleg Nesterov, (Mon Mar 31, 1:07 pm)
Re: [PATCH 1/3] do_wait reorganization, Roland McGrath, (Mon Mar 31, 1:29 pm)
Re: [PATCH 2/2] ptrace children revamp, Roland McGrath, (Fri Apr 4, 2:00 pm)
Re: [PATCH 2/2] ptrace children revamp, Oleg Nesterov, (Sat Apr 5, 7:06 am)
Re: [PATCH 2/2] ptrace children revamp, Roland McGrath, (Wed Apr 9, 1:15 pm)
Re: [PATCH 2/2] ptrace children revamp, Oleg Nesterov, (Sun Apr 13, 7:24 am)
Re: [PATCH 2/2] ptrace children revamp, Roland McGrath, (Mon Apr 14, 6:41 pm)