In the Linux kernel, the following vulnerability has been resolved:
kthread: consolidate kthread exit paths to prevent use-after-free
Guillaume reported crashes via corrupted RCU callback function pointers during KUnit testing. The crash was traced back to the pidfs rhashtable conversion which replaced the 24-byte rb_node with an 8-byte rhash_head in struct pid, shrinking it from 160 to 144 bytes.
struct kthread (without CONFIG_BLK_CGROUP) is also 144 bytes. With CONFIG_SLAB_MERGE_DEFAULT and SLAB_HWCACHE_ALIGN both round up to 192 bytes and share the same slab cache. struct pid.rcu.func and struct kthread.affinity_node both sit at offset 0x78.
When a kthread exits via make_task_dead() it bypasses kthread_exit() and misses the affinity_node cleanup. free_kthread_struct() frees the memory while the node is still linked into the global kthread_affinity_list. A subsequent list_del() by another kthread writes through dangling list pointers into the freed and reused memory, corrupting the pid's rcu.func pointer.
Instead of patching free_kthread_struct() to handle the missed cleanup, consolidate all kthread exit paths. Turn kthread_exit() into a macro that calls do_exit() and add kthread_do_exit() which is called from do_exit() for any task with PF_KTHREAD set. This guarantees that kthread-specific cleanup always happens regardless of the exit path - make_task_dead(), direct do_exit(), or kthread_exit().
Replace __to_kthread() with a new tsk_is_kthread() accessor in the public header. Export do_exit() since module code using the kthread_exit() macro now needs it directly.
CVSS Details
- CVSS 3.1 Base Score: 9.8
- CVSS 3.1 Vector: (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Redhat_linux | — | No solution exists | Jul 17, 2026 | May 8, 2026 |
| Ubuntu | — | Upgrade linux-image-nvidia-64k-hwe-24.04Upgrade linux-image-azureUpgrade linux-image-oem-24.04aUpgrade linux-image-oracle-64kUpgrade linux-image-oem-24.04Upgrade linux-image-6.17.0-40-generic-64kUpgrade linux-image-raspi-6.17Upgrade linux-image-virtual-hwe-24.04Upgrade linux-image-aws-64kUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-generic-hwe-24.04Upgrade linux-image-aws-64k-6.17Upgrade linux-image-6.17.0-1018-oracle-64kUpgrade linux-image-raspiUpgrade linux-image-gcpUpgrade linux-image-nvidia-hwe-24.04Upgrade linux-image-gcp-64kUpgrade linux-image-6.17.0-1018-azure-fdeUpgrade linux-image-aws-6.17Upgrade linux-image-6.17.0-1021-raspiUpgrade linux-image-virtual-6.17Upgrade linux-image-oem-24.04cUpgrade linux-image-oem-24.04dUpgrade linux-image-realtime-6.17Upgrade linux-image-6.17.0-40-genericUpgrade linux-image-azure-6.17Upgrade linux-image-nvidia-64k-6.17Upgrade linux-image-generic-64kUpgrade linux-image-genericUpgrade linux-image-generic-64k-6.17Upgrade linux-image-6.17.0-1018-oracleUpgrade linux-image-awsUpgrade linux-image-gcp-64k-6.17Upgrade linux-image-azure-fde-6.17Upgrade linux-image-gcp-6.17Upgrade linux-image-realtimeUpgrade linux-image-azure-fdeUpgrade linux-image-oracle-6.17Upgrade linux-image-6.17.0-1028-oemUpgrade linux-image-oracle-64k-6.17Upgrade linux-image-6.17.0-1026-nvidia-64kUpgrade linux-image-6.17.0-1026-nvidiaUpgrade linux-image-6.17.0-1021-azureUpgrade linux-image-6.17.0-1019-aws-64kUpgrade linux-image-oracleUpgrade linux-image-oem-24.04bUpgrade linux-image-oem-6.17Upgrade linux-image-6.17.0-1017-realtimeUpgrade linux-image-virtualUpgrade linux-image-nvidia-6.17Upgrade linux-image-6.17.0-1020-gcpUpgrade linux-image-6.17.0-1019-awsUpgrade linux-image-generic-6.17Upgrade linux-image-6.17.0-1020-gcp-64kUpgrade linux-image-generic-64k-hwe-24.04 | Jul 1, 2026 | May 8, 2026 |
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