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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.18% (percentile 4, 2026-11-26)
- **CWE:** CWE-367
- **Published:** 2025-07-04T13:37:34.532Z
- **Modified:** 2026-06-17T09:16:24.533Z

## Who should check

- Anyone running Linux \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< d95d87841d2a575bed3691884e8fedef57d7710d; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 83e2ba8971ccd8fc08319fc7593288f070d80a76; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 4d646f627d3b7ed1cacca66e598af8bcd632d465; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf
- Anyone running 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.

## Affected and fixed versions

- Linux: \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< d95d87841d2a575bed3691884e8fedef57d7710d; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 83e2ba8971ccd8fc08319fc7593288f070d80a76; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 4d646f627d3b7ed1cacca66e598af8bcd632d465; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf (cvelist)
- Linux: 6.3 (cvelist)

## Mitigation

- Upgrade Linux to 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-38217. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-38217.md
Affected: Linux >= 1c5759d8ce054961b454af69568a41e7e3210ee1, < d95d87841d2a575bed3691884e8fedef57d7710d; >= 1c5759d8ce054961b454af69568a41e7e3210ee1, < 83e2ba8971ccd8fc08319fc7593288f070d80a76; >= 1c5759d8ce054961b454af69568a41e7e3210ee1, < 4d646f627d3b7ed1cacca66e598af8bcd632d465; >= 1c5759d8ce054961b454af6…
Fixed in: Linux 83e2ba8971ccd8fc08319fc7593288f070d80a76, Linux 4d646f627d3b7ed1cacca66e598af8bcd632d465, Linux 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-38217 being exploited?

There is no confirmed exploitation: CVE-2025-38217 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.18% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2025-38217?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2025-38217?

Linux \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< d95d87841d2a575bed3691884e8fedef57d7710d; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 83e2ba8971ccd8fc08319fc7593288f070d80a76; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 4d646f627d3b7ed1cacca66e598af8bcd632d465; \>= 1c5759d8ce054961b454af69568a41e7e3210ee1, \< 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf; Linux 6.3.

### Is there a fix for CVE-2025-38217?

Yes. Fixed in Linux 83e2ba8971ccd8fc08319fc7593288f070d80a76, Linux 4d646f627d3b7ed1cacca66e598af8bcd632d465, Linux 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf. Upgrade Linux to 14c9ede9ca4cd078ad76a6ab9617b81074eb58bf or later.

### How do I check if I'm affected by CVE-2025-38217?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

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

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2025-38217>

HTML: <https://flawdb.com/CVE-2025-38217> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-38217>
