HIGH Introduced in 6.18
hwmon PECStore UAF
CVE-2026-98000
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: hwmon: Fix potential UAF in pec_store Sashiko reports: In pec_store(), a guard(mutex)(&hwdev->lock) is taken. If the chip write operation returns an error other than -EOPNOTSUPP, the code jumps to the put label, which calls put_device(hdev). If this drops the final reference, the device is freed. When the function then returns, the guard cleanup function runs and attempts to unlock the freed mutex. Use scoped_guard() instead of guard() to avoid the problem.
02KernelScan AI Analysis
Risk summary
A local attacker who can write to a hardware monitoring sysfs attribute can trigger a use-after-free when a chip write returns an error and the device is concurrently removed. This corrupts freed kernel heap memory, potentially leading to privilege escalation or a kernel crash. The vulnerability requires an hwmon device using the _with_info() API and a race with device teardown.
Vulnerability analysis
When a hardware monitoring chip write operation returns an error other than not-supported, the error path drops a device reference that may be the last one. If concurrent device removal has already drained other references, this drop frees the device while a lock guard still holds a mutex embedded in that device. The guard cleanup then attempts to unlock the already-freed mutex, causing a use-after-free on kernel heap memory. The fix narrows the lock scope so the mutex is released before the device reference is dropped, preventing the guard from touching freed memory. This path is reachable from local userspace by writing to a hardware monitoring sysfs attribute, and triggering the use-after-free requires winning a race with concurrent device removal.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.18 | 6.18 | 6.18.53 | 8afab57bcdbc |
| 7.2 | 6.18 | 7.2.7 | 01dd8b4fc2cf |
| mainline | 6.18 | 7.3-rc3 | 354ccc99b2dc |