Add ability to enter a cgroup namespace

The cgroup namespacing feature was recently added to the linux kernel.
Allow jailed processes to be placed in to a new cgroup namespace.  This
avoids leaking host info into the jailed process and allows for the
jailed process to use cgroups as it would if it was running outside of
any namespaces.  Android needs this so its cgroup setting CTS tests can
pass and it can distribute its cpu shares between background and
foreground apps.

CQ-DEPEND=CL:356201
BUG=b/29259708
TEST=minijail0 -m '0 1000 100' -M '0 1000 100' -N /bin/bash
  check that the cgroup namespace is different
  check that a newly mounted cgroup FS is rooted at the parent's cgroup

Change-Id: I3aead23ec8273eae90184337c040054becf4f12b
Signed-off-by: Dylan Reid <dgreid@chromium.org>
3 files changed