Re: [PATCH 2/3] pidns: Guarantee that the pidns init will be thelast pidns process reaped.

From: Oleg Nesterov
Date: Fri May 18 2012 - 08:40:42 EST


On 05/17, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@xxxxxxxxxx> writes:
>
> > What do you think?
>
> I think there is something very compelling about your solution,
> we do need my bit about making the init process ignore SIGCHLD
> so all of init's children self reap.

Not sure I understand. This can work with or without 3/3 which
changes zap_pid_ns_processes() to ignore SIGCHLD. And just in
case, I think 3/3 is fine.

And once again, this wait_event() + __wake_up_parent() is very
simple and straightforward, we can cleanup this code later if
needed.


> > Do you mean the "if (tsk->ptrace)" code in exit_notify() ? Nobody
> > understand it ;) Last time this code was modified by me (iirc), but
> > I simply tried to preserve the previous behaviour.
>
> Yes. It is some pretty strange code.

Yes. In particular, I think it should always use SIGCHLD.

> Especially where we are reading
> a return result which is always false. I think there is a bug somewhere
> between that code and ptrace detach

Yes. This is the known oddity. We always notify the tracer if the
leader exits, even if !thread_group_empty(). But after that the
tracer can't detach, and it can't do do_wait(WEXITED).

The problem is not that we can't "fix" this. Just any discussed
fix adds the subtle/incompatible user-visible change.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/