CVE-2026-99488: klist: avoid accesses after waking klist_remove()
In the Linux kernel, the following vulnerability has been resolved:
klist: avoid accesses after waking klistremove()
klistremove() waits until a node is unreferenced so that its caller can free the containing object. klistrelease() currently publishes waiter->woken and wakes the waiter before its final accesses to the waiter and node. klistremove() can then return, allowing its stack waiter and the containing object to be freed or reused while klistrelease() is still running. In particular, busremovedriver() can free drv->p while deviceattach() walks the same bus klist with busforeachdrv().
On an arm64 Cortex-A72 system, an unpatched 7.2.0-rc3 kernel with CONFIGPREEMPTRT=y and CONFIGKASAN=y reproduced the bug through the in-tree I2C/at24 path. KASAN reported a use-after-free in klistdecanddel() reached from klistnext()/busforeachdrv() while at24 was being unregistered.
Clear nklist and take a task reference before publishing woken. Use release/acquire accesses for that publication and wake the referenced task. The task reference keeps the waiter task alive if it returns and exits before wakeupprocess().
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.117 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Compensating control
In klist_release(), clear n_klist and take a reference to the waiter task before publishing waiter->woken; use release/acquire accesses for that publication and wake the referenced task.