Skip to content

RFC namespace enter through hijack

Serge E. Hallyn containers 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2namespace enter: introduce do_fork_task()arch/i386/kernel/process.c arch/s390/kernel/process.c include/linux/pid.h +7 more+93 -370 replies
2/2namespace enter: introduce sys_hijack (v3)arch/i386/kernel/process.c arch/i386/kernel/syscall_table.S include/asm-i386/unistd.h +4 more+68 -16 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC] [PATCH 0/2] namespace enter through hijack

This patchset implements namespace entering by forcing a task in the target namespace to clone itself. This has some advantages over just replacing a random task's namespace pointers to the target ones. In particular

1. If switching pid namespaces, the stack of upids is automatically correctly generated.
2. Security context is inherited from the target task. Assuming a security module which labels data based on the task security context, like selinux, this may prevent severe mislabeling of container data by an inadvertant host system administrator action. Whether that works or not will still depend on the policy and the task cloned.

While this version takes a pid of a process to clone (for convenience of prototyping) we may prefer to use a ns_container name and choose one of it's tasks, to prevent pid wraparound.

Tested and 'works for me', but at the moment I'm just sending this out for discussion.

Alternatives to this include bind_ns()+switch_ns() by Cedric and the ns_container namespace entering enhancements I've previously sent.

thanks,
-serge