CVE-2025-38217

hwmon: (ftsteutates) Fix TOCTOU race in fts_read()

MEDIUM
4.7
CVSS Score
Published: July 4, 2025 at 01:37 PM UTC
Updated: June 17, 2026 at 09:16 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM4.7
Exploit prediction
EPSS 0.1%

Description

In the Linux kernel, the following vulnerability has been resolved: hwmon: (ftsteutates) Fix TOCTOU race in fts_read() In the fts_read() function, when handling hwmon_pwm_auto_channels_temp, the code accesses the shared variable data->fan_source[channel] twice without holding any locks. It is first checked against FTS_FAN_SOURCE_INVALID, and if the check passes, it is read again when used as an argument to the BIT() macro. This creates a Time-of-Check to Time-of-Use (TOCTOU) race condition. Another thread executing fts_update_device() can modify the value of data->fan_source[channel] between the check and its use. If the value is changed to FTS_FAN_SOURCE_INVALID (0xff) during this window, the BIT() macro will be called with a large shift value (BIT(255)). A bit shift by a value greater than or equal to the type width is undefined behavior and can lead to a crash or incorrect values being returned to userspace. Fix this by reading data->fan_source[channel] into a local variable once, eliminating the race condition. Additionally, add a bounds check to ensure the value is less than BITS_PER_LONG before passing it to the BIT() macro, making the code more robust against undefined behavior. This possible bug was found by an experimental static analysis tool developed by our team.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

6.13 ≤ v < 6.15.46.3 ≤ v < 6.12.356.3 ≤ v < 6.15.46.3 ≤ v < 6.166.3 ≤ v < 6.6.956.7 ≤ v < 6.12.351c5759d8ce054961b454af69568a41e7e3210ee16.16 rc16.16 rc26.3
Vendor states this is fixed in 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf (fixed)
Vendor states this is fixed in 4d646f627d3b7ed1cacca66e598af8bcd632d465 (fixed)
Vendor states this is fixed in 83e2ba8971ccd8fc08319fc7593288f070d80a76 (fixed)
Vendor states this is fixed in d95d87841d2a575bed3691884e8fedef57d7710d (fixed)
Vendor states this is fixed in 6.12.35 (unaffected)
Vendor states this is fixed in 6.15.4 (unaffected)
Vendor states this is fixed in 6.16 (unaffected)
Vendor states this is fixed in 6.3 (unaffected)
Vendor states this is fixed in 6.6.95 (unaffected)

References (4)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/14c9ede9ca4cd078ad76a6ab9617b81074eb58bf
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/4d646f627d3b7ed1cacca66e598af8bcd632d465
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/83e2ba8971ccd8fc08319fc7593288f070d80a76
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/d95d87841d2a575bed3691884e8fedef57d7710d

CVSS

Attack Vector
LOCAL
Complexity
HIGH
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-367

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card