CVE-2026-139193: cgroup/cpuset: Properly compute effective xcpus in update_parent_effective_cpumask()
In the Linux kernel, the following vulnerability has been resolved:
cgroup/cpuset: Properly compute effective xcpus in updateparenteffectivecpumask()
Since the introduction of cpuset.cpus.exclusive in commit e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2"), a computeeffectiveexclusivecpumask() helper which is later renamed to computeexcpus() is added to compute the effective xcpus of a partition root. However updateparenteffectivecpumask() is not updated in all proper places to use the new helper to check if a given cpuset should remain a valid partition root. This can cause a cpuset to incorrectly remain a valid partition root even if no effective xcpus is left.
Fix that problem by using computeexcpus() to compute the effective xcpus into delmask in all cases except partcmddisable, partcmdinvalidate or partcmdupdate with newmask set and use it for tasksnocpuerror() check as well as checking its emptiness. This enables us to catch invalid partition root more accurately in updateparenteffectivecpumask().
In the case of partcmdupdate with newmask set, the passed in new effective xcpus value will directly be used in the tasksnocpuerror() check without relying on old data in the cpuset.
For the partcmdupdate with NULL newmask case, the cpu exclusivity test there is also relaxed to be performed only if exclusivecpus is empty.
Some test case are added to testcpusetprs.sh for invalidating a partition root due to its effective xcpus becoming empty as well as making sure that an invalid partition can only be revived when exclusive CPUs are available agin.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In update_parent_effective_cpumask(), use compute_excpus() to compute effective xcpus, and use the computed value for the tasks_nocpu_error() check and partition-root validity checks.
Event History
Frequently Asked Questions
Which Linux configurations are relevant to this issue?
The issue is relevant to Linux systems using cgroup v2 cpusets with cpuset.cpus.exclusive and partition roots. It concerns cases where a partition root can lose all effective exclusive CPUs.
What is the operational impact of the incorrect state?
A cpuset can incorrectly remain marked as a valid partition root even when it has no effective exclusive CPUs. This can prevent invalid partition-root state from being detected accurately during parent effective CPU mask updates.
What should be checked after applying the fix?
Verify that partition roots with no effective exclusive CPUs are detected as invalid during relevant cpuset updates. The corrected logic uses the computed effective exclusive CPU mask when checking task no-CPU errors and whether the mask is empty.