CVE-2026-98000: hwmon: Fix potential UAF in pec_store
From: Greg Kroah-Hartman <[email protected]>
Description
===========
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.
The Linux kernel CVE team has assigned CVE-2026-98000 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.18 with commit 3ad2a7b9b15d5072139a20be84adb36776eb6c9b and fixed in 6.18.53 with commit 8afab57bcdbc2186f325972e777880ac5a220f4f Issue introduced in 6.18 with commit 3ad2a7b9b15d5072139a20be84adb36776eb6c9b and fixed in 7.2.7 with commit 01dd8b4fc2cf83c66565c0f382fb1841e9000a89 Issue introduced in 6.18 with commit 3ad2a7b9b15d5072139a20be84adb36776eb6c9b and fixed in 7.3-rc3 with commit 354ccc99b2dc8ba0cf6d4de34e520bcf6ecca5c2
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-98000
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:
drivers/hwmon/hwmon.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/8afab57bcdbc2186f325972e777880ac5a220f4f https://git.kernel.org/stable/c/01dd8b4fc2cf83c66565c0f382fb1841e9000a89 https://git.kernel.org/stable/c/354ccc99b2dc8ba0cf6d4de34e520bcf6ecca5c2