]> git.baikalelectronics.ru Git - kernel.git/commit
cgroupns: Only allow creation of hierarchies in the initial cgroup namespace
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 15 Jul 2016 11:36:44 +0000 (06:36 -0500)
committerTejun Heo <tj@kernel.org>
Fri, 15 Jul 2016 12:04:27 +0000 (08:04 -0400)
commitc5cee628b2e3d31f2af73c4a18dc2816f1f3ebb9
treebb968dbabc116836617716bed9f854261f6eb15f
parent9655a0fe65201945982978cee8982439cc016837
cgroupns: Only allow creation of hierarchies in the initial cgroup namespace

Unprivileged users can't use hierarchies if they create them as they do not
have privilieges to the root directory.

Which means the only thing a hiearchy created by an unprivileged user
is good for is expanding the number of cgroup links in every css_set,
which is a DOS attack.

We could allow hierarchies to be created in namespaces in the initial
user namespace.  Unfortunately there is only a single namespace for
the names of heirarchies, so that is likely to create more confusion
than not.

So do the simple thing and restrict hiearchy creation to the initial
cgroup namespace.

Cc: stable@vger.kernel.org
Fixes: cd5be6032d83 ("cgroup: introduce cgroup namespaces")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup.c