Skip to content

pid namespace cleanups and enhancements

Eric W. Biederman containers lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 26 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11procfs: Use the proc generic infrastructure for proc/self.fs/proc/Makefile fs/proc/base.c fs/proc/internal.h +2 more+64 -1521 reply
2/11procfs: Don't cache a pid in the root inode.fs/proc/base.c fs/proc/root.c+1 -181 reply
3/11pidns: Capture the user namespace and filter ns_last_pidinclude/linux/pid_namespace.h kernel/nsproxy.c kernel/pid.c +1 more+18 -91 reply
4/11pidns: Use task_active_pid_ns where appropriatearch/powerpc/platforms/cell/spufs/sched.c arch/um/drivers/mconsole_kern.c drivers/staging/android/binder.c +9 more+16 -151 reply
5/11pidns: Make the pidns proc mount/umount logic obvious.fs/proc/base.c fs/proc/root.c include/linux/pid_namespace.h +3 more+26 -221 reply
6/11pidns: Don't allow new processes in a dead pid namespace.kernel/pid.c+7 -11 reply
7/11pidns: Wait in zap_pid_ns_processes until pid_ns->nr_hashed == 1kernel/exit.c kernel/pid.c kernel/pid_namespace.c+17 -268 replies
8/11pidns: Deny strange cases when creating pid namespaces.kernel/pid_namespace.c+2 -01 reply
9/11pidns: Add setns supportfs/proc/namespaces.c include/linux/proc_fs.h kernel/pid_namespace.c+58 -03 replies
10/11pidns: Consolidate initialzation of special init task stateinit/main.c kernel/fork.c+3 -41 reply
11/11pidns: Support unsharing the pid namespace.kernel/fork.c kernel/nsproxy.c kernel/pid_namespace.c+26 -108 replies

Reviews trailers per patch

All 11 patches have a Reviewed-by or Acked-by.

PatchSerge HallynSerge E. HallynGao feng
1/11A-b
2/11A-b
3/11A-b A-b
4/11A-b
5/11A-b A-b
6/11A-b A-b
7/11A-b A-b
8/11A-b
9/11A-b
10/11A-b
11/11A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [REVIEW][PATCH 0/11] pid namespace cleanups and enhancements

This patchset is my pile of pid namespace patches that I have been sitting on for entirely too long. I have been running and testing these changes for a while but if anyone sees any problems please let me know.

Feature wise this patchset adds unshare and setns support for the pid namespace.

Cleanup wise this patchset adds an explicit count of how many pids are hashed in a pid namespace and uses that count to trigger the unmounting of the internal kernel mount of proc. The current scheme is buggy and entirely too clever to continue living.

Some proc bits that were added to support the pid namespace initially are removed, as they are no no longer necessary.

These patches are also available at:
git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace.git pidns-v73

Since some of this work is closely allied with the user namespace bits I have pending I intend to merge these changes through my user namespace tree.

Eric W. Biederman (11):
procfs: Use the proc generic infrastructure for proc/self.
procfs: Don't cache a pid in the root inode.
pidns: Capture the user namespace and filter ns_last_pid
pidns: Use task_active_pid_ns where appropriate
pidns: Make the pidns proc mount/umount logic obvious.
pidns: Don't allow new processes in a dead pid namespace.
pidns: Wait in zap_pid_ns_processes until pid_ns->nr_hashed == 1
pidns: Deny strange cases when creating pid namespaces.
pidns: Add setns support
pidns: Consolidate initialzation of special init task state
pidns: Support unsharing the pid namespace.

 arch/powerpc/platforms/cell/spufs/sched.c |    2 +-
 arch/um/drivers/mconsole_kern.c           |    2 +-
 drivers/staging/android/binder.c          |    3 +-
 fs/hppfs/hppfs.c                          |    2 +-
 fs/proc/Makefile                          |    1 +
 fs/proc/base.c                            |  169 +----------------------------
 fs/proc/internal.h                        |    1 +
 fs/proc/namespaces.c                      |    3 +
 fs/proc/root.c                            |   16 +---
 fs/proc/self.c                            |   59 ++++++++++
 include/linux/pid_namespace.h             |   10 ++-
 include/linux/proc_fs.h                   |    1 +
 init/main.c                               |    1 -
 kernel/cgroup.c                           |    2 +-
 kernel/events/core.c                      |    2 +-
 kernel/exit.c                             |   12 --
 kernel/fork.c                             |   42 +++++---
 kernel/nsproxy.c                          |    4 +-
 kernel/pid.c                              |   46 +++++++--
 kernel/pid_namespace.c                    |   99 +++++++++++++----
 kernel/signal.c                           |    2 +-
 kernel/sysctl_binary.c                    |    2 +-
 22 files changed, 231 insertions(+), 250 deletions(-)