CVE-2026-99488: klist: avoid accesses after waking klist_remove()
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
klist: avoid accesses after waking klist_remove()
klist_remove() waits until a node is unreferenced so that its caller can free the containing object. klist_release() currently publishes waiter->woken and wakes the waiter before its final accesses to the waiter and node. klist_remove() can then return, allowing its stack waiter and the containing object to be freed or reused while klist_release() is still running. In particular, bus_remove_driver() can free drv->p while __device_attach() walks the same bus klist with bus_for_each_drv().
On an arm64 Cortex-A72 system, an unpatched 7.2.0-rc3 kernel with CONFIG_PREEMPT_RT=y and CONFIG_KASAN=y reproduced the bug through the in-tree I2C/at24 path. KASAN reported a use-after-free in klist_dec_and_del() reached from klist_next()/bus_for_each_drv() while at24 was being unregistered.
Clear n_klist 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 wake_up_process().
The Linux kernel CVE team has assigned CVE-2026-99488 to this issue.
Affected and fixed versions
===========================
Issue introduced in 2.6.13 with commit 8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 and fixed in 6.12.117 with commit 3fee2a5ef405f08ea3d87d2014ae7d38e61dd06f Issue introduced in 2.6.13 with commit 8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 and fixed in 6.18.61 with commit d655ef174056457d1c3bc06b4405097e0a9b3bf5 Issue introduced in 2.6.13 with commit 8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 and fixed in 7.3.2 with commit 7d3df012573523cb2f38a65e3e00125d9869b390 Issue introduced in 2.6.13 with commit 8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 and fixed in 7.4-rc1 with commit 732e3e10234cbe302d0dcbaa98c91c66628209cb
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-99488
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
lib/klist.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/3fee2a5ef405f08ea3d87d2014ae7d38e61dd06f https://git.kernel.org/stable/c/d655ef174056457d1c3bc06b4405097e0a9b3bf5 https://git.kernel.org/stable/c/7d3df012573523cb2f38a65e3e00125d9869b390 https://git.kernel.org/stable/c/732e3e10234cbe302d0dcbaa98c91c66628209cb