Security Vulnerability Report
中文
CVE-2026-43439 CVSS 4.7 MEDIUM

CVE-2026-43439

Published: 2026-05-08 15:16:56
Last Modified: 2026-05-21 17:26:46
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

Description

In the Linux kernel, the following vulnerability has been resolved: cgroup: fix race between task migration and iteration When a task is migrated out of a css_set, cgroup_migrate_add_task() first moves it from cset->tasks to cset->mg_tasks via: list_move_tail(&task->cg_list, &cset->mg_tasks); If a css_task_iter currently has it->task_pos pointing to this task, css_set_move_task() calls css_task_iter_skip() to keep the iterator valid. However, since the task has already been moved to ->mg_tasks, the iterator is advanced relative to the mg_tasks list instead of the original tasks list. As a result, remaining tasks on cset->tasks, as well as tasks queued on cset->mg_tasks, can be skipped by iteration. Fix this by calling css_set_skip_task_iters() before unlinking task->cg_list from cset->tasks. This advances all active iterators to the next task on cset->tasks, so iteration continues correctly even when a task is concurrently being migrated. This race is hard to hit in practice without instrumentation, but it can be reproduced by artificially slowing down cgroup_procs_show(). For example, on an Android device a temporary /sys/kernel/cgroup/cgroup_test knob can be added to inject a delay into cgroup_procs_show(), and then: 1) Spawn three long-running tasks (PIDs 101, 102, 103). 2) Create a test cgroup and move the tasks into it. 3) Enable a large delay via /sys/kernel/cgroup/cgroup_test. 4) In one shell, read cgroup.procs from the test cgroup. 5) Within the delay window, in another shell migrate PID 102 by writing it to a different cgroup.procs file. Under this setup, cgroup.procs can intermittently show only PID 101 while skipping PID 103. Once the migration completes, reading the file again shows all tasks as expected. Note that this change does not allow removing the existing css_set_skip_task_iters() call in css_set_move_task(). The new call in cgroup_migrate_add_task() only handles iterators that are racing with migration while the task is still on cset->tasks. Iterators may also start after the task has been moved to cset->mg_tasks. If we dropped css_set_skip_task_iters() from css_set_move_task(), such iterators could keep task_pos pointing to a migrating task, causing css_task_iter_advance() to malfunction on the destination css_set, up to and including crashes or infinite loops. The race window between migration and iteration is very small, and css_task_iter is not on a hot path. In the worst case, when an iterator is positioned on the first thread of the migrating process, cgroup_migrate_add_task() may have to skip multiple tasks via css_set_skip_task_iters(). However, this only happens when migration and iteration actually race, so the performance impact is negligible compared to the correctness fix provided here.

CVSS Details

CVSS Score
4.7
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* - VULNERABLE
Linux Kernel (Mainline)
Linux Kernel (Stable branches before patch)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/bin/bash # This is a reproduction script based on the vulnerability description. # It requires a kernel with instrumentation (cgroup_test knob) to hit the race reliably. CGROUP_PATH="/sys/fs/cgroup/test_cgroup" # Step 1: Create a test cgroup mkdir -p $CGROUP_PATH # Step 2: Spawn three long-running tasks task1 & task2 & task3 & # Move tasks to the test cgroup echo $! > $CGROUP_PATH/cgroup.procs # Step 3: Inject delay (if cgroup_test interface exists) # echo 1000 > /sys/kernel/cgroup/cgroup_test # Step 4 & 5: Trigger race condition # In one shell, read procs (iteration) # In another shell, migrate a task (migration) # Simulating the race by running in background ( cat $CGROUP_PATH/cgroup.procs ) & ( sleep 0.001 # Artificial delay to widen race window # Migrate task2 to a different cgroup echo <PID_OF_TASK2> > /sys/fs/cgroup/another_cgroup/cgroup.procs ) & wait # Check if tasks were skipped in the first read echo "Check cgroup.procs content manually to verify if tasks were skipped."

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-43439", "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "published": "2026-05-08T15:16:56.263", "lastModified": "2026-05-21T17:26:45.540", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ncgroup: fix race between task migration and iteration\n\nWhen a task is migrated out of a css_set, cgroup_migrate_add_task()\nfirst moves it from cset->tasks to cset->mg_tasks via:\n\n list_move_tail(&task->cg_list, &cset->mg_tasks);\n\nIf a css_task_iter currently has it->task_pos pointing to this task,\ncss_set_move_task() calls css_task_iter_skip() to keep the iterator\nvalid. However, since the task has already been moved to ->mg_tasks,\nthe iterator is advanced relative to the mg_tasks list instead of the\noriginal tasks list. As a result, remaining tasks on cset->tasks, as\nwell as tasks queued on cset->mg_tasks, can be skipped by iteration.\n\nFix this by calling css_set_skip_task_iters() before unlinking\ntask->cg_list from cset->tasks. This advances all active iterators to\nthe next task on cset->tasks, so iteration continues correctly even\nwhen a task is concurrently being migrated.\n\nThis race is hard to hit in practice without instrumentation, but it\ncan be reproduced by artificially slowing down cgroup_procs_show().\nFor example, on an Android device a temporary\n/sys/kernel/cgroup/cgroup_test knob can be added to inject a delay\ninto cgroup_procs_show(), and then:\n\n 1) Spawn three long-running tasks (PIDs 101, 102, 103).\n 2) Create a test cgroup and move the tasks into it.\n 3) Enable a large delay via /sys/kernel/cgroup/cgroup_test.\n 4) In one shell, read cgroup.procs from the test cgroup.\n 5) Within the delay window, in another shell migrate PID 102 by\n writing it to a different cgroup.procs file.\n\nUnder this setup, cgroup.procs can intermittently show only PID 101\nwhile skipping PID 103. Once the migration completes, reading the\nfile again shows all tasks as expected.\n\nNote that this change does not allow removing the existing\ncss_set_skip_task_iters() call in css_set_move_task(). The new call\nin cgroup_migrate_add_task() only handles iterators that are racing\nwith migration while the task is still on cset->tasks. Iterators may\nalso start after the task has been moved to cset->mg_tasks. If we\ndropped css_set_skip_task_iters() from css_set_move_task(), such\niterators could keep task_pos pointing to a migrating task, causing\ncss_task_iter_advance() to malfunction on the destination css_set,\nup to and including crashes or infinite loops.\n\nThe race window between migration and iteration is very small, and\ncss_task_iter is not on a hot path. In the worst case, when an\niterator is positioned on the first thread of the migrating process,\ncgroup_migrate_add_task() may have to skip multiple tasks via\ncss_set_skip_task_iters(). However, this only happens when migration\nand iteration actually race, so the performance impact is negligible\ncompared to the correctness fix provided here."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 4.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.0, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-362"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.14.138", "versionEndExcluding": "4.15", "matchCriteriaId": "78CA4E3F-334F-491E-ADB6-3C747B08A8A7"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "4.19.66", "versionEndExcluding": "4.20", "matchCriteriaId": "B7E77755-6955-4016-B730-47CF831C8F4F"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.2.1", "versionEndExcluding": "5.10.253", "matchCriteriaId": "65130A9E-8E4F-498E-8BBC-19CCD46BBEDD"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.11", "versionEndExcluding": "5.15.203", "matchCriteriaId": "20DDB3E9-AABF-4107-ADB0-5362AA067045"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.16", "versionEndExcluding": "6.1.167", "matchCriteriaId": "2EDC6BAF-B710-4E26-B6AA-D68922EE7B43"}, {"vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.2", "versionEndExcluding": "6.6.130", "matchCrit ... (truncated)