Skip to content

pidns: Closing the pid namespace exit race.

Eric W. Biederman linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3pidns: Use task_active_pid_ns in do_notify_parent.kernel/signal.c+5 -60 replies
2/3pidns: Guarantee that the pidns init will be the last pidns process reaped.kernel/exit.c+35 -1123 replies
3/3pidns: Make killed children autoreapkernel/pid_namespace.c+6 -11 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchEric W. Biederman
1/3
2/3A-b
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] pidns: Closing the pid namespace exit race.

I had some patches that broke the circular reference between the pid_namespace and the proc_mnt by combining the reference counts but the world has changes and now the proc_mnt reference count is not suitable to be used that way so that plan is scrapped.

I did play with it and I have found a relatively elegant way of at least handling the problem of self reaping children escaping from zap_pid_ns_processess.

The following patches guarantee that the task with pid == 1 will be the last task reaped in a pid namespace. Making proc_flush_task safe.

The previous patch to call pid_ns_release_proc on fork failure is still needed. These patches simply address the other failure mode.

How did it escape my memory that setting SIGCHLD to SIG_IGN caused children to autoreap?

Eric W. Biederman (3):
pidns: Use task_active_pid_ns in do_notify_parent.
pidns: Guarantee that the pidns init will be the last pidns process reaped.
pidns: Make killed children autoreap

 kernel/exit.c          |   46 +++++++++++++++++++++++++++++++++++-----------
 kernel/pid_namespace.c |    7 ++++++-
 kernel/signal.c        |   11 +++++------
 3 files changed, 46 insertions(+), 18 deletions(-)