{"id":"CVE-2026-43439","aliases":["CVE-2026-43439"],"related":[],"kind":"vulnerability","state":"published","title":"cgroup: fix race between task migration and iteration","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\ncgroup: corrige la condición de carrera entre la migración de tareas y la iteración\n\nCuando una tarea es migrada fuera de un css_set, cgroup_migrate_add_task() primero la mueve de cset  ->  tasks a cset  ->  mg_tasks a través de:\n\n    list_move_tail(&task  ->  cg_list, &cset  ->  mg_tasks);\n\nSi un css_task_iter actualmente tiene it  ->  task_pos apuntando a esta tarea, css_set_move_task() llama a css_task_iter_skip() para mantener el iterador válido. Sin embargo, dado que la tarea ya ha sido movida a   ->  mg_tasks, el iterador avanza en relación con la lista mg_tasks en lugar de la lista de tareas original. Como resultado, las tareas restantes en cset  ->  tasks, así como las tareas en cola en cset  ->  mg_tasks, pueden ser omitidas por la iteración.\n\nEsto se soluciona llamando a css_set_skip_task_iters() antes de desvincular task  ->  cg_list de cset  ->  tasks. Esto avanza todos los iteradores activos a la siguiente tarea en cset  ->  tasks, de modo que la iteración continúa correctamente incluso cuando una tarea está siendo migrada concurrentemente.\n\nEsta condición de carrera es difícil de encontrar en la práctica sin instrumentación, pero puede reproducirse ralentizando artificialmente cgroup_procs_show(). Por ejemplo, en un dispositivo Android se puede añadir un ’knob’ temporal /sys/kernel/cgroup/cgroup_test para inyectar un retardo en cgroup_procs_show(), y luego:\n\n  1) Generar tres tareas de larga duración (PIDs 101, 102, 103).\n  2) Crear un cgroup de prueba y mover las tareas a él.\n  3) Habilitar un gran retardo a través de /sys/kernel/cgroup/cgroup_test.\n  4) En una shell, leer cgroup.procs del cgroup de prueba.\n  5) Dentro de la ventana de retardo, en otra shell migrar el PID 102 escribiéndolo en un archivo cgroup.procs diferente.\n\nBajo esta configuración, cgroup.procs puede mostrar intermitentemente solo el PID 101 mientras omite el PID 103. Una vez que la migración se completa, leer el archivo de nuevo muestra todas las tareas como se espera.\n\nTenga en cuenta que este cambio no permite eliminar la llamada existente a css_set_skip_task_iters() en css_set_move_task(). La nueva llamada en cgroup_migrate_add_task() solo maneja los iteradores que están en condición de carrera con la migración mientras la tarea todavía está en cset  ->  tasks. Los iteradores también pueden comenzar después de que la tarea haya sido movida a cset  ->  mg_tasks. Si elimináramos css_set_skip_task_iters() de css_set_move_task(), dichos iteradores podrían mantener task_pos apuntando a una tarea en migración, causando que css_task_iter_advance() funcione incorrectamente en el css_set de destino, hasta e incluyendo fallos o bucles infinitos.\n\nLa ventana de condición de carrera entre la migración y la iteración es muy pequeña, y css_task_iter no está en una ruta crítica (’hot path’). En el peor de los casos, cuando un iterador está posicionado en el primer hilo del proceso en migración, cgroup_migrate_add_task() podría tener que omitir múltiples tareas a través de css_set_skip_task_iters(). Sin embargo, esto solo ocurre cuando la migración y la iteración realmente entran en condición de carrera, por lo que el impacto en el rendimiento es insignificante en comparación con la corrección de exactitud proporcionada aquí.","source":"nvd"}],"published":"2026-05-08T14:22:08.626Z","modified":"2026-11-11T20:10:00.273Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-362"],"affected":[{"ranges":[{"type":"git","introduced":"b636fd38dc40113f853337a7d2a6885ad23b8811","fixed":"7c85debc35e6d131bd29c64f2ae78c6ede0e55c4","status":"affected"},{"type":"git","introduced":"b636fd38dc40113f853337a7d2a6885ad23b8811","fixed":"3b95abab7369235a37b15eaec6e1a0b443bba7c7","status":"affected"},{"type":"git","introduced":"b636fd38dc40113f853337a7d2a6885ad23b8811","fixed":"4a9654a2b46cfdaae287fb8995f536245635e467","status":"affected"},{"type":"git","introduced":"b636fd38dc40113f853337a7d2a6885ad23b8811","fixed":"3dfd1328c05234e8d8fa61948b2ba82680594988","status":"affected"},{"type":"git","introduced":"b636fd38dc40113f853337a7d2a6885ad23b8811","fixed":"9cca530c7cc1b3e02cb8fa7f80060dd4b38562ce","status":"affected"},{"type":"git","introduced":"b636fd38dc40113f853337a7d2a6885ad23b8811","fixed":"86ceaccfdfa16dad05addb33dc206e03589bcfd1","status":"affected"},{"type":"git","introduced":"b636fd38dc40113f853337a7d2a6885ad23b8811","fixed":"9dc76f6fc0d28d2382583715bc4ec22f28104845","status":"affected"},{"type":"git","introduced":"b636fd38dc40113f853337a7d2a6885ad23b8811","fixed":"5ee01f1a7343d6a3547b6802ca2d4cdce0edacb1","status":"affected"},{"type":"git","version":"b0af004fd58ded5f898630db008c5b824c27d7db","status":"affected"},{"type":"git","version":"370b9e6399da09fe10005fe455878b356de7b85f","status":"affected"},{"type":"semver","introduced":"4.14.138","fixed":"4.15","status":"affected"},{"type":"semver","introduced":"4.19.66","fixed":"4.20","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.2","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.2","status":"unaffected"},{"type":"semver","introduced":"5.10.253","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.203","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.167","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.130","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.78","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.19","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.9","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.14.138","fixed":"4.15"},{"status":"affected","introduced":"4.19.66","fixed":"4.20"},{"status":"affected","introduced":"5.2.1","fixed":"5.10.253"},{"status":"affected","introduced":"5.11","fixed":"5.15.203"},{"status":"affected","introduced":"5.16","fixed":"6.1.167"},{"status":"affected","introduced":"6.2","fixed":"6.6.130"},{"status":"affected","introduced":"6.7","fixed":"6.12.78"},{"status":"affected","introduced":"6.13","fixed":"6.18.19"},{"status":"affected","introduced":"6.19","fixed":"6.19.9"},{"status":"affected","version":"5.2"},{"status":"affected","version":"5.2"},{"status":"affected","version":"5.2"},{"status":"affected","version":"5.2"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/7c85debc35e6d131bd29c64f2ae78c6ede0e55c4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3b95abab7369235a37b15eaec6e1a0b443bba7c7","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/4a9654a2b46cfdaae287fb8995f536245635e467","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3dfd1328c05234e8d8fa61948b2ba82680594988","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9cca530c7cc1b3e02cb8fa7f80060dd4b38562ce","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/86ceaccfdfa16dad05addb33dc206e03589bcfd1","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9dc76f6fc0d28d2382583715bc4ec22f28104845","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5ee01f1a7343d6a3547b6802ca2d4cdce0edacb1","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-06T15:38:43.233Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43439","url":"https://www.cve.org/CVERecord?id=CVE-2026-43439","licence":"CVE Terms of Use","modified":"2026-11-06T15:42:54.051Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43439","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43439","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"}],"updatedAt":"2026-11-25T22:59:21.069Z","epss":{"score":0.0009,"percentile":0.00429,"date":"2026-12-01T12:00:22.000Z"}}