CVE-2026-99718: hwmon: (peci/dimmtemp) Fix devres leak and UAF on concurrent unbind
In the Linux kernel, the following vulnerability has been resolved:
hwmon: (peci/dimmtemp) Fix devres leak and UAF on concurrent unbind
When a pecidimmtemp device is unbound concurrently with its delayed initialization work (detectwork), newly allocated devm resources and the hwmon device are leaked, leading to a use-after-free when reading the lingering hwmon sysfs attributes.
In pecidimmtempprobe(), detectwork is registered for cancellation via devmdelayedworkautocancel(). During driver detach, devresreleaseall() first moves all existing entries from dev->devreshead onto a local todo list before invoking their release callbacks in reverse order. If createdimmtempinfodelayed() is already running when devmdelayedworkdrop() calls canceldelayedworksync(), createdimmtempinfo() can allocate dimmtemplabel strings via devmkzalloc()/devmkasprintf() and register the hwmon device via devmhwmondeviceregisterwithinfo(), appending new devres entries to the now-empty dev->devreshead. Once the work finishes, devresreleaseall() frees priv and priv->name from the local todo list without re-evaluating dev->devreshead, leaving the late devres allocations and registered hwmon device behind with a dangling priv pointer.
Cancel detectwork synchronously in a driver .remove() callback instead of relying on devmdelayedworkautocancel() so that the work is fully drained before devresreleaseall() detaches dev->devreshead, allowing any devm resources registered by the delayed work to be released in proper reverse order. Also only schedule detectwork when checkpopulateddimms() returns -EAGAIN so that probe failure paths do not leave delayed work pending.
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.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Compensating control
In the peci/dimmtemp driver, cancel detect_work synchronously with cancel_delayed_work_sync() in the .remove() callback instead of relying on devm_delayed_work_autocancel().
Frequently Asked Questions
What systems are exposed to this issue?
Systems using the Linux kernel PECI DIMM temperature hardware-monitoring driver are exposed when a peci_dimmtemp device can be unbound while its delayed initialization work is running. The issue involves the hwmon sysfs interface left behind by that race.
What condition is required to trigger the use-after-free?
A concurrent driver detach or device unbind must occur while the detect_work delayed initialization is already executing. That work must then allocate managed resources and register the hwmon device after devres cleanup has moved existing resources to its local release list.
What is the observable impact if the race occurs?
The late-created hwmon device and managed resources can remain registered after the driver state has been freed. Reading the lingering hwmon sysfs attributes can then cause a use-after-free.