• Tejun Heo's avatar
    cgroup: fix rule checking for threaded mode switching · d1897c95
    Tejun Heo authored
    A domain cgroup isn't allowed to be turned threaded if its subtree is
    populated or domain controllers are enabled.  cgroup_enable_threaded()
    depended on cgroup_can_be_thread_root() test to enforce this rule.  A
    parent which has populated domain descendants or have domain
    controllers enabled can't become a thread root, so the above rules are
    enforced automatically.
    
    However, for the root cgroup which can host mixed domain and threaded
    children, cgroup_can_be_thread_root() doesn't check any of those
    conditions and thus first level cgroups ends up escaping those rules.
    
    This patch fixes the bug by adding explicit checks for those rules in
    cgroup_enable_threaded().
    Reported-by: default avatarMichael Kerrisk (man-pages) <mtk.manpages@gmail.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Fixes: 8cfd8147 ("cgroup: implement cgroup v2 thread support")
    Cc: stable@vger.kernel.org # v4.14+
    d1897c95
Name
Last commit
Last update
..
Makefile Loading commit data...
cgroup-internal.h Loading commit data...
cgroup-v1.c Loading commit data...
cgroup.c Loading commit data...
cpuset.c Loading commit data...
debug.c Loading commit data...
freezer.c Loading commit data...
namespace.c Loading commit data...
pids.c Loading commit data...
rdma.c Loading commit data...
stat.c Loading commit data...