Re: [PATCH 2/4] pid_ns: (BUG 11391) change ->child_reaper wheninit->group_leader exits

From: sukadev
Date: Wed Aug 27 2008 - 14:08:09 EST


Oleg Nesterov [oleg@xxxxxxxxxx] wrote:
| We don't change pid_ns->child_reaper when the main thread of the
| subnamespace init exits. As Robert Rex <robert.rex@xxxxxxxxxx>
| pointed out this is wrong.
|
| Yes, the re-parenting itself works correctly, but if the reparented
| task exits it needs ->parent->nsproxy->pid_ns in do_notify_parent(),
| and if the main thread is zombie its ->nsproxy was already cleared
| by exit_task_namespaces().
|
| Introduce the new function, find_new_reaper(), which finds the new
| ->parent for the re-parenting and changes ->child_reaper if needed.
| Kill the now unneeded exit_child_reaper().
|
| Also move the changing of ->child_reaper from zap_pid_ns_processes()
| to find_new_reaper(), this consolidates the games with ->child_reaper
| and makes it stable under tasklist_lock.
|
| Reported-by: Robert Rex <robert.rex@xxxxxxxxxx>
| Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

Acked-by: Sukadev Bhattiprolu <sukadev@xxxxxxxxxxxxxxxxxx>
--
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/