]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: implement "nsdelegate" mount option
authorTejun Heo <tj@kernel.org>
Tue, 27 Jun 2017 18:30:28 +0000 (14:30 -0400)
committerTejun Heo <tj@kernel.org>
Wed, 28 Jun 2017 18:45:21 +0000 (14:45 -0400)
commit7e286d0c9309836dd1809ec140edc6ca84c9cd24
treedcbc7414985c212f5a9fddb6bdcac553f6014928
parent5521dea63dba6d78962d303e9a4b80ed71ea8b41
cgroup: implement "nsdelegate" mount option

Currently, cgroup only supports delegation to !root users and cgroup
namespaces don't get any special treatments.  This limits the
usefulness of cgroup namespaces as they by themselves can't be safe
delegation boundaries.  A process inside a cgroup can change the
resource control knobs of the parent in the namespace root and may
move processes in and out of the namespace if cgroups outside its
namespace are visible somehow.

This patch adds a new mount option "nsdelegate" which makes cgroup
namespaces delegation boundaries.  If set, cgroup behaves as if write
permission based delegation took place at namespace boundaries -
writes to the resource control knobs from the namespace root are
denied and migration crossing the namespace boundary aren't allowed
from inside the namespace.

This allows cgroup namespace to function as a delegation boundary by
itself.

v2: Silently ignore nsdelegate specified on !init mounts.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Aravind Anbudurai <aru7@fb.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Documentation/cgroup-v2.txt
include/linux/cgroup-defs.h
kernel/cgroup/cgroup.c