CVE-2025-38217 Details
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.
A Time-of-Check to Time-of-Use (TOCTOU) race condition vulnerability has been identified in the Linux kernel's hwmon (ftsteutates) component. The issue arises in the fts_read() function, which manages hwmon_pwm_auto_channels_temp. The code accesses the shared variable data->fan_source[channel] twice without proper locking. Initially, it checks the value against FTS_FAN_SOURCE_INVALID, and if the check is passed, it reads the value again to use with the BIT() macro. This creates a window where another thread executing fts_update_device() could modify data->fan_source[channel], potentially changing it to FTS_FAN_SOURCE_INVALID. If this occurs, the BIT() macro would be called with an invalid large shift value, leading to undefined behavior that could cause a crash or incorrect values being sent to userspace. The vulnerability has been addressed by modifying the code to read data->fan_source[channel] into a local variable once, thereby eliminating the race condition. A bounds check was also added to ensure the value is less than BITS_PER_LONG before using it with the BIT() macro, enhancing the code's robustness against undefined behavior.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
No SSVC data is available for this CVE.
References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://git.kernel.org/stable/c/14c9ede9ca4cd078ad76a6ab9617b81074eb58bf | kernel.org | Patch |
| https://git.kernel.org/stable/c/4d646f627d3b7ed1cacca66e598af8bcd632d465 | kernel.org | Patch |
| https://git.kernel.org/stable/c/83e2ba8971ccd8fc08319fc7593288f070d80a76 | kernel.org | Patch |
| https://git.kernel.org/stable/c/d95d87841d2a575bed3691884e8fedef57d7710d | kernel.org | Patch |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-367 | Time-of-check Time-of-use (TOCTOU) Race Condition | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| linux linux kernel | >= 6.3, < 6.6.95 >= 6.7, < 6.12.35 >= 6.13, < 6.15.4 6.16 rc1 6.16 rc2 |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | kernel.org |
| Nov 18, 2025 | Initial Analysis | [email protected] |
| Jul 4, 2025 | New CVE Received | kernel.org |