Skip to content

Introduce the cloning with pids functionality

Pavel Emelyanov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 26 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3pids: Make alloc_pid return errorkernel/fork.c kernel/pid.c+6 -52 replies
2/3pids: Split alloc_pidmap into partskernel/pid.c+22 -151 reply
3/3pids: Make it possible to clone tasks with given pidsinclude/linux/pid.h include/linux/sched.h kernel/fork.c +1 more+42 -623 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] Introduce the cloning with pids functionality

When restoring a task (or a set of tasks) we need to recreate them with exactly the same pid(s) as they had before. Thus we need the ability to create a task with specified pid. The proposal is to reuse the already free CLONE_STOPPED clone flag, introduce the new one called CLONE_CHILD_USEPIDS and point to the desired pids with the child_tidptr.

There are two cnages from the previous set doing the same.

1. The child_tidptr points to an array of pids for current namespace and its ancestors. When 0 is met in this array the pid number for the corresponding namespace is generated, rather than set.

2. For security reasons after a regular clone/fork is done in a namespace further cloning with predefined pid is not allowed.