klist: avoid accesses after waking klist_remove()

State
Published
Severity
Not Scored
Published
Nov 19, 2026
Updated
Nov 23, 2026
Reserved
Sep 25, 2026

Read the record on cve.org

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().

ProductVersions
Linux Linux8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 to before 224f1c87086b9bc15bfc2dc0fd6f23df265eb976 Affected8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 to before 2c3bbc8a1acd7b52a7785b51994a39aa336e2c08 Affected8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 to before 428846fffb806a2c1e7f5f9bb976964f011c8803 Affected8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 to before 1da13ac31040f1fb7365e994f84a6b2e32043363 Affected8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 to before 3fee2a5ef405f08ea3d87d2014ae7d38e61dd06f Affected8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 to before d655ef174056457d1c3bc06b4405097e0a9b3bf5 Affected8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 to before 7d3df012573523cb2f38a65e3e00125d9869b390 Affected8b0c250be489dcbf1a3a33bb4ec4c7f33735a365 to before 732e3e10234cbe302d0dcbaa98c91c66628209cb Affected
Linux Linux2.6.13 Affectedbefore 2.6.13 Not Affected5.10.275 through 5.10.* Not Affected5.15.226 through 5.15.* Not Affected6.1.193 through 6.1.* Not Affected6.6.163 through 6.6.* Not Affected6.12.117 through 6.12.* Not Affected6.18.61 through 6.18.* Not Affected7.3.2 through 7.3.* Not Affected7.4-rc1 and later Not Affected

Weaknesses

The record names no weakness.

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.