In the Linux kernel, the following vulnerability has been resolved:
cgroup: Use separate src/dst nodes when preloading css_sets for migration
Each cset (css_set) is pinned by its tasks. When we're moving tasks around across csets for a migration, we need to hold the source and destination csets to ensure that they don't go away while we're moving tasks about. This is done by linking cset->mg_preload_node on either the mgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using the same cset->mg_preload_node for both the src and dst lists was deemed okay as a cset can't be both the source and destination at the same time.
Unfortunately, this overloading becomes problematic when multiple tasks are involved in a migration and some of them are identity noop migrations while others are actually moving across cgroups. For example, this can happen with the following sequence on cgroup1:
#1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procs
the process including the group leader back into a. In this final migration, non-leader threads would be doing identity migration while the group leader is doing an actual one.
After #3, let's say the whole process was in cset A, and that after #4, the leader moves to cset B. Then, during #6, the following happens:
1. cgroup_migrate_add_src() is called on B for the leader.
2. cgroup_migrate_add_src() is called on A for the other threads.
3. cgroup_migrate_prepare_dst() is called. It scans the src list.
4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy.
5. and then it notices A wants to migrate to A as it's an identity migration, it culls it by list_del_init()'ing its ->mg_preload_node and putting references accordingly.
6. The rest of migration takes place with B on the src list but nothing on the dst list.
This means that A isn't held while migration is in progress. If all tasks leave A before the migration finishes and the incoming task pins it, the cset will be destroyed leading to use-after-free.
This is caused by overloading cset->mg_preload_node for both src and dst preload lists. We wanted to exclude the cset from the src list but ended up inadvertently excluding it from the dst list too.
This patch fixes the issue by separating out cset->mg_preload_node into ->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dst preloadings don't interfere with each other.
CVSS Details
- CVSS 3.1 Base Score: 7.8
- CVSS 3.1 Vector: (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Amazon Linux Ami 2 | — | Upgrade kernel-livepatch-5.15.57-29.131Upgrade kernel-toolsUpgrade kernel-livepatch-5.10.135-122.509Upgrade kernel-debuginfo-common-aarch64Upgrade perf-debuginfoUpgrade perfUpgrade kernel-tools-develUpgrade kernel-livepatch-4.14.290-217.505Upgrade kernel-develUpgrade kernel-tools-debuginfoUpgrade kernel-headersUpgrade bpftoolUpgrade bpftool-debuginfoUpgrade kernel-debuginfo-common-x86_64Upgrade kernelUpgrade python-perfUpgrade kernel-debuginfoUpgrade python-perf-debuginfo | Mar 14, 2025 | Feb 26, 2025 |
| Amazon_linux | — | Upgrade kernel | Mar 14, 2025 | Oct 11, 2022 |
| Debian | — | Upgrade linux | Feb 27, 2025 | Feb 27, 2025 |
| Huawei Euleros 2_0_sp10 | — | Upgrade kernel-toolsUpgrade kernel-abi-stablelistsUpgrade python3-perfUpgrade kernel-tools-libsUpgrade kernel | May 13, 2025 | Feb 26, 2025 |
| Huawei Euleros 2_0_sp11 | — | Upgrade bpftoolUpgrade kernel-tools-libsUpgrade kernel-toolsUpgrade kernelUpgrade kernel-abi-stablelistsUpgrade python3-perf | Jun 13, 2025 | Feb 26, 2025 |
| Huawei Euleros 2_0_sp12 | — | Upgrade kernel-abi-stablelistsUpgrade kernelUpgrade python3-perfUpgrade kernel-toolsUpgrade bpftoolUpgrade kernel-tools-libs | Jun 11, 2025 | Feb 26, 2025 |
| Huawei Euleros 2_0_sp13 | — | Upgrade python3-perfUpgrade kernel-toolsUpgrade bpftoolUpgrade kernel-abi-stablelistsUpgrade kernel-tools-libsUpgrade kernel | Jul 1, 2025 | Feb 26, 2025 |
| Redhat_linux | — | No solution exists | Jul 9, 2025 | Feb 26, 2025 |
| Ubuntu | — | Upgrade linux-hwe-5.4Upgrade linux-iotUpgrade linux-azure-4.15Upgrade linux-ibm-5.4Upgrade linuxUpgrade linux-oracle-5.15Upgrade linux-gcp-4.15Upgrade linux-lowlatencyUpgrade linux-raspiUpgrade linux-hwe-5.15Upgrade linux-aws-fipsUpgrade linux-azure-fipsUpgrade linux-gkeopUpgrade linux-azure-5.4Upgrade linux-gcp-5.4Upgrade linux-aws-5.4Upgrade linux-azure-5.15Upgrade linux-hweUpgrade linux-awsUpgrade linux-azureUpgrade linux-aws-hweUpgrade linux-riscv-5.15Upgrade linux-intel-iotgUpgrade linux-gcp-5.15Upgrade linux-oracle-5.4Upgrade linux-nvidiaUpgrade linux-ibmUpgrade linux-aws-5.15Upgrade linux-bluefieldUpgrade linux-gcp-fipsUpgrade linux-realtimeUpgrade linux-lowlatency-hwe-5.15Upgrade linux-oracleUpgrade linux-raspi-5.4Upgrade linux-azure-fdeUpgrade linux-gkeUpgrade linux-fipsUpgrade linux-intel-iotg-5.15Upgrade linux-kvmUpgrade linux-gcp | Mar 3, 2025 | Feb 26, 2025 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | May 27, 2026 | Feb 26, 2025 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub