{"id":"CVE-2026-43402","aliases":["CVE-2026-43402"],"related":[],"kind":"vulnerability","state":"published","title":"kthread: consolidate kthread exit paths to prevent use-after-free","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nkthread: consolidate kthread exit paths to prevent use-after-free\n\nGuillaume reported crashes via corrupted RCU callback function pointers\nduring KUnit testing. The crash was traced back to the pidfs rhashtable\nconversion which replaced the 24-byte rb_node with an 8-byte rhash_head\nin struct pid, shrinking it from 160 to 144 bytes.\n\nstruct kthread (without CONFIG_BLK_CGROUP) is also 144 bytes. With\nCONFIG_SLAB_MERGE_DEFAULT and SLAB_HWCACHE_ALIGN both round up to\n192 bytes and share the same slab cache. struct pid.rcu.func and\nstruct kthread.affinity_node both sit at offset 0x78.\n\nWhen a kthread exits via make_task_dead() it bypasses kthread_exit() and\nmisses the affinity_node cleanup. free_kthread_struct() frees the memory\nwhile the node is still linked into the global kthread_affinity_list. A\nsubsequent list_del() by another kthread writes through dangling list\npointers into the freed and reused memory, corrupting the pid's\nrcu.func pointer.\n\nInstead of patching free_kthread_struct() to handle the missed cleanup,\nconsolidate all kthread exit paths. Turn kthread_exit() into a macro\nthat calls do_exit() and add kthread_do_exit() which is called from\ndo_exit() for any task with PF_KTHREAD set. This guarantees that\nkthread-specific cleanup always happens regardless of the exit path -\nmake_task_dead(), direct do_exit(), or kthread_exit().\n\nReplace __to_kthread() with a new tsk_is_kthread() accessor in the\npublic header. Export do_exit() since module code using the\nkthread_exit() macro now needs it directly.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nkthread: consolidate kthread exit paths to prevent use-after-free\n\nGuillaume reported crashes via corrupted RCU callback function pointers\nduring KUnit testing. The crash was traced back to the pidfs rhashtable\nconversion which replaced the 24-byte rb_node with an 8-byte rhash_head\nin struct pid, shrinking it from 160 to 144 bytes.\n\nstruct kthread (without CONFIG_BLK_CGROUP) is also 144 bytes. With\nCONFIG_SLAB_MERGE_DEFAULT and SLAB_HWCACHE_ALIGN both round up to\n192 bytes and share the same slab cache. struct pid.rcu.func and\nstruct kthread.affinity_node both sit at offset 0x78.\n\nWhen a kthread exits via make_task_dead() it bypasses kthread_exit() and\nmisses the affinity_node cleanup. free_kthread_struct() frees the memory\nwhile the node is still linked into the global kthread_affinity_list. A\nsubsequent list_del() by another kthread writes through dangling list\npointers into the freed and reused memory, corrupting the pid's\nrcu.func pointer.\n\nInstead of patching free_kthread_struct() to handle the missed cleanup,\nconsolidate all kthread exit paths. Turn kthread_exit() into a macro\nthat calls do_exit() and add kthread_do_exit() which is called from\ndo_exit() for any task with PF_KTHREAD set. This guarantees that\nkthread-specific cleanup always happens regardless of the exit path -\nmake_task_dead(), direct do_exit(), or kthread_exit().\n\nReplace __to_kthread() with a new tsk_is_kthread() accessor in the\npublic header. Export do_exit() since module code using the\nkthread_exit() macro now needs it directly.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nkthread: consolidar las rutas de salida de kthread para prevenir el uso después de liberación\n\nGuillaume informó de fallos a través de punteros de función de callback RCU corruptos durante las pruebas de KUnit. El fallo se rastreó hasta la conversión de rhashtable de pidfs que reemplazó el rb_node de 24 bytes con un rhash_head de 8 bytes en la estructura pid, reduciéndola de 160 a 144 bytes.\n\nLa estructura kthread (sin CONFIG_BLK_CGROUP) también es de 144 bytes. Con CONFIG_SLAB_MERGE_DEFAULT y SLAB_HWCACHE_ALIGN, ambos se redondean a 192 bytes y comparten la misma caché de slab. struct pid.rcu.func y struct kthread.affinity_node ambos se encuentran en el desplazamiento 0x78.\n\nCuando un kthread sale a través de make_task_dead(), omite kthread_exit() y la limpieza de affinity_node. free_kthread_struct() libera la memoria mientras el nodo aún está vinculado a la kthread_affinity_list global. Una posterior list_del() por otro kthread escribe a través de punteros de lista colgantes en la memoria liberada y reutilizada, corrompiendo el puntero rcu.func del pid.\n\nEn lugar de parchear free_kthread_struct() para manejar la limpieza omitida, consolidar todas las rutas de salida de kthread. Convertir kthread_exit() en una macro que llama a do_exit() y añadir kthread_do_exit() que es llamada desde do_exit() para cualquier tarea con PF_KTHREAD establecido. Esto garantiza que la limpieza específica de kthread siempre ocurre independientemente de la ruta de salida - make_task_dead(), do_exit() directo, o kthread_exit().\n\nReemplazar __to_kthread() con un nuevo accesor tsk_is_kthread() en el encabezado público. Exportar do_exit() ya que el código del módulo que usa la macro kthread_exit() ahora lo necesita directamente.","source":"nvd"}],"published":"2026-05-08T14:21:43.550Z","modified":"2026-11-11T20:10:00.273Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"4d13f4304fa43471bfea101658a11feec7b28ac0","fixed":"4729c7b00a347fd37d0cbc265b85f2884c3e06b6","status":"affected"},{"type":"git","introduced":"4d13f4304fa43471bfea101658a11feec7b28ac0","fixed":"5a591d7a5e48d30100943940a30a6ab41b15c672","status":"affected"},{"type":"git","introduced":"4d13f4304fa43471bfea101658a11feec7b28ac0","fixed":"28aaa9c39945b7925a1cc1d513c8f21ed38f5e4f","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.14","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.14","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":"6.14","fixed":"6.18.19"},{"status":"affected","introduced":"6.19","fixed":"6.19.9"},{"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/4729c7b00a347fd37d0cbc265b85f2884c3e06b6","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5a591d7a5e48d30100943940a30a6ab41b15c672","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/28aaa9c39945b7925a1cc1d513c8f21ed38f5e4f","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-10-16T15:17:02.801Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-43402","url":"https://www.cve.org/CVERecord?id=CVE-2026-43402","licence":"CVE Terms of Use","modified":"2026-10-19T19:16:28.340Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-43402","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-43402","licence":"Public domain","modified":"2026-11-11T20:10:00.273Z"}],"updatedAt":"2026-11-25T22:59:21.048Z","epss":{"score":0.00557,"percentile":0.47834,"date":"2026-12-01T12:00:22.000Z"}}