Patch "cgroup: fix rule checking for threaded mode switching" has been added to the 4.14-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
cgroup: fix rule checking for threaded mode switching
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
cgroup-fix-rule-checking-for-threaded-mode-switching.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
d1897c9538edafd4ae6bbd03cc075962ddde2c21Mon Sep 17 00:00:00 2001
From: Tejun Heo <[email protected]>
Date: Wed, 21 Feb 2018 11:39:22 -0800
Subject: cgroup: fix rule checking for threaded mode switching
From: Tejun Heo <[email protected]>
commit d1897c9538edafd4ae6bbd03cc075962ddde2c21 upstream.
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().
--- kernel/cgroup/cgroup.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
kernel/cgroup/cgroup.c +10 -0
@@ -3148,6 +3148,16 @@ static int cgroup_enable_threaded(structif (cgroup_is_threaded (cgrp))return 0 ; +/* +* If @cgroup is populated or has domain controllers enabled, it +* can't be switched. While the below cgroup_can_be_thread_root() +* test can catch the same conditions, that's only when @parent is +* not mixable, so let's check it explicitly. +*/ +if (cgroup_is_populated (cgrp) || + cgrp->subtree_control & ~cgrp_dfl_threaded_ss_mask) +return -EOPNOTSUPP ; +/* we're joining the parent's domain, ensure its validity */ if (!cgroup_is_valid_domain (dom_cgrp) || !cgroup_can_be_thread_root (dom_cgrp))
Patches currently in stable-queue which might be from [email protected] are
queue-4.14/libata-disable-lpm-for-crucial-bx100-ssd-500gb-drive.patch queue-4.14/libata-apply-nolpm-quirk-to-crucial-m500-480-and-960gb-ssds.patch queue-4.14/libata-fix-length-validation-of-atapi-relayed-scsi-commands.patch queue-4.14/libata-apply-nolpm-quirk-to-crucial-mx100-512gb-ssds.patch queue-4.14/pci-add-function-1-dma-alias-quirk-for-highpoint-rocketraid-644l.patch queue-4.14/libata-modify-quirks-for-mx100-to-limit-ncq_trim-quirk-to-mu01-version.patch queue-4.14/libata-enable-queued-trim-for-samsung-ssd-860.patch queue-4.14/ahci-add-pci-id-for-the-highpoint-rocketraid-644l-card.patch queue-4.14/cgroup-fix-rule-checking-for-threaded-mode-switching.patch queue-4.14/libata-make-crucial-bx100-500gb-lpm-quirk-apply-to-all-firmware-versions.patch queue-4.14/libata-remove-warn-for-dma-or-pio-command-without-data.patch queue-4.14/libata-don-t-try-to-pass-through-ncq-commands-to-non-ncq-devices.patch