# CVE-2025-21664: dm thin: make get\_first\_thin use rcu-safe list first function

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.33% (percentile 19, 2026-11-26)
- **Published:** 2025-01-21T12:18:19.015Z
- **Modified:** 2026-10-15T22:18:07.507Z

## Who should check

- Anyone running Linux \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< ec037fe8c0d0f6140e3d8a49c7b29cb5582160b8; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< cd30a3960433ec2db94b3689752fa3c5df44d649; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 802666a40c71a23542c43a3f87e3a2d0f4e8fe45; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 12771050b6d059eea096993bf2001da9da9fddff; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 6b305e98de0d225ccebfb225730a9f560d28ecb0; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< cbd0d5ecfa390ac29c5380200147d09c381b2ac6; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 80f130bfad1dab93b95683fc39b87235682b8f72
- Anyone running Linux 3.15

## Description

In the Linux kernel, the following vulnerability has been resolved:

dm thin: make get\_first\_thin use rcu-safe list first function

The documentation in rculist.h explains the absence of list\_empty\_rcu()
and cautions programmers against relying on a list\_empty() -\>
list\_first() sequence in RCU safe code.  This is because each of these
functions performs its own READ\_ONCE() of the list head.  This can lead
to a situation where the list\_empty() sees a valid list entry, but the
subsequent list\_first() sees a different view of list head state after a
modification.

In the case of dm-thin, this author had a production box crash from a GP
fault in the process\_deferred\_bios path.  This function saw a valid list
head in get\_first\_thin() but when it subsequently dereferenced that and
turned it into a thin\_c, it got the inside of the struct pool, since the
list was now empty and referring to itself.  The kernel on which this
occurred printed both a warning about a refcount\_t being saturated, and
a UBSAN error for an out-of-bounds cpuid access in the queued spinlock,
prior to the fault itself.  When the resulting kdump was examined, it
was possible to see another thread patiently waiting in thin\_dtr's
synchronize\_rcu.

The thin\_dtr call managed to pull the thin\_c out of the active thins
list (and have it be the last entry in the active\_thins list) at just
the wrong moment which lead to this crash.

Fortunately, the fix here is straight forward.  Switch get\_first\_thin()
function to use list\_first\_or\_null\_rcu() which performs just a single
READ\_ONCE() and returns NULL if the list is already empty.

This was run against the devicemapper test suite's thin-provisioning
suites for delete and suspend and no regressions were observed.

## Affected and fixed versions

- Linux: \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< ec037fe8c0d0f6140e3d8a49c7b29cb5582160b8; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< cd30a3960433ec2db94b3689752fa3c5df44d649; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 802666a40c71a23542c43a3f87e3a2d0f4e8fe45; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 12771050b6d059eea096993bf2001da9da9fddff; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 6b305e98de0d225ccebfb225730a9f560d28ecb0; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< cbd0d5ecfa390ac29c5380200147d09c381b2ac6; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 80f130bfad1dab93b95683fc39b87235682b8f72 (cvelist)
- Linux: 3.15 (cvelist)

## Mitigation

- Upgrade Linux to 80f130bfad1dab93b95683fc39b87235682b8f72 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-21664. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21664.md
Affected: Linux >= b10ebd34cccae1b431caf1be54919aede2be7cbe, < ec037fe8c0d0f6140e3d8a49c7b29cb5582160b8; >= b10ebd34cccae1b431caf1be54919aede2be7cbe, < cd30a3960433ec2db94b3689752fa3c5df44d649; >= b10ebd34cccae1b431caf1be54919aede2be7cbe, < 802666a40c71a23542c43a3f87e3a2d0f4e8fe45; >= b10ebd34cccae1b431caf1b…
Fixed in: Linux 802666a40c71a23542c43a3f87e3a2d0f4e8fe45, Linux 12771050b6d059eea096993bf2001da9da9fddff, Linux 6b305e98de0d225ccebfb225730a9f560d28ecb0, Linux 80f130bfad1dab93b95683fc39b87235682b8f72

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-21664 being exploited?

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< ec037fe8c0d0f6140e3d8a49c7b29cb5582160b8; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< cd30a3960433ec2db94b3689752fa3c5df44d649; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 802666a40c71a23542c43a3f87e3a2d0f4e8fe45; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 12771050b6d059eea096993bf2001da9da9fddff; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 6b305e98de0d225ccebfb225730a9f560d28ecb0; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< cbd0d5ecfa390ac29c5380200147d09c381b2ac6; \>= b10ebd34cccae1b431caf1be54919aede2be7cbe, \< 80f130bfad1dab93b95683fc39b87235682b8f72; Linux 3.15.

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

Yes. Fixed in Linux 802666a40c71a23542c43a3f87e3a2d0f4e8fe45, Linux 12771050b6d059eea096993bf2001da9da9fddff, Linux 6b305e98de0d225ccebfb225730a9f560d28ecb0, Linux 80f130bfad1dab93b95683fc39b87235682b8f72. Upgrade Linux to 80f130bfad1dab93b95683fc39b87235682b8f72 or later.

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

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/ec037fe8c0d0f6140e3d8a49c7b29cb5582160b8>
- patch: <https://git.kernel.org/stable/c/cd30a3960433ec2db94b3689752fa3c5df44d649>
- patch: <https://git.kernel.org/stable/c/802666a40c71a23542c43a3f87e3a2d0f4e8fe45>
- patch: <https://git.kernel.org/stable/c/12771050b6d059eea096993bf2001da9da9fddff>
- patch: <https://git.kernel.org/stable/c/6b305e98de0d225ccebfb225730a9f560d28ecb0>
- patch: <https://git.kernel.org/stable/c/cbd0d5ecfa390ac29c5380200147d09c381b2ac6>
- patch: <https://git.kernel.org/stable/c/80f130bfad1dab93b95683fc39b87235682b8f72>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-265688.html>

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

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