CVE-2025-38217
hwmon: (ftsteutates) Fix TOCTOU race in fts_read()
Check your servers for CVE-2025-38217
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-38217 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
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.
Exploitation
EPSS 0.13%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 2.95% of all scored CVEs. Scores of 1 Dec 2026.
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 1c5759d8ce054961b454af69568a41e7e3210ee1, before d95d87841d2a575bed3691884e8fedef57d7710d affected from 1c5759d8ce054961b454af69568a41e7e3210ee1, before 83e2ba8971ccd8fc08319fc7593288f070d80a76 affected from 1c5759d8ce054961b454af69568a41e7e3210ee1, before 4d646f627d3b7ed1cacca66e598af8bcd632d465 affected from 1c5759d8ce054961b454af69568a41e7e3210ee1, before 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf
Other versions: unaffected
|
| Linux |
affected 6.3 unaffected before 6.3 unaffected from 6.6.95 up to and including 6.6.* unaffected from 6.12.35 up to and including 6.12.* unaffected from 6.15.4 up to and including 6.15.* unaffected 6.16 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-38217 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-38217
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2025-38217
trivy image --scanners vuln IMAGE | grep CVE-2025-38217
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/d95d87841d2a575bed3691884e8fedef57d7710d git.kernel.org
- https://git.kernel.org/stable/c/83e2ba8971ccd8fc08319fc7593288f070d80a76 git.kernel.org
- https://git.kernel.org/stable/c/4d646f627d3b7ed1cacca66e598af8bcd632d465 git.kernel.org
- https://git.kernel.org/stable/c/14c9ede9ca4cd078ad76a6ab9617b81074eb58bf git.kernel.org
Source: the record CVE-2025-38217 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse