KernelScan.io

HIGH Introduced in 6.18

hwmon PECStore UAF

CVE-2026-98000

CVSS 7.0 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

01

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.

02

Engine v0.6.0

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.

Affecteddrivers/hwmon/hwmon.c (hwmon core)

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.

03

BranchIntroducedFixed inPatch commit
6.186.186.18.538afab57bcdbc
7.26.187.2.701dd8b4fc2cf
mainline6.187.3354ccc99b2dc