Vulnerability · Published Jan 21, 2025 · Assigned by Linux

CVE-2025-21664dm thin: make get_first_thin use rcu-safe list first function

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 15% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.2%top 85.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.128-1DEBIAN-CVE-2025-21664
Debian:12linux6.1.128-1DSA-5860-1
Debian:13linux6.12.10-1DEBIAN-CVE-2025-21664
Debian:14linux6.12.10-1DEBIAN-CVE-2025-21664
Ubuntu:22.04:LTSlinux5.15.0-135.146UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux6.8.0-60.63UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-aws5.15.0-1080.87UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-aws6.8.0-1029.31UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1029.31~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-azure5.15.0-1084.93UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-azure6.8.0-1029.34UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-azure-6.116.11.0-1012.12~24.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1029.34~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1084.93.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-azure-nvidia6.8.0-1016.17UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-gcp5.15.0-1079.88UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-gcp6.8.0-1030.32UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-gcp-6.116.11.0-1011.11~24.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-gcp-6.86.8.0-1030.32~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-gke5.15.0-1077.83UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-gke6.8.0-1025.29UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1062.70UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-gkeop6.8.0-1012.14UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-hwe-6.116.11.0-21.21~24.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-hwe-6.86.8.0-60.63~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-ibm5.15.0-1072.75UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-ibm6.8.0-1026.26UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-ibm-6.86.8.0-1026.26~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-intel-iot-realtime5.15.0-1073.75UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1075.81UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-kvm5.15.0-1076.81UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-135.146UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-60.63.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.86.8.0-60.63.1~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1074.75UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1028.31UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-nvidia-6.116.11.0-1007.7UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1028.31~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-nvidia-lowlatency6.8.0-1028.31.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1033.33UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-nvidia-tegra6.8.0-1008.8UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1021.21UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-oem-6.116.11.0-1017.17UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1028.28UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-oracle5.15.0-1077.83UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-oracle6.8.0-1026.27UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1026.27~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-raspi5.15.0-1074.77UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-raspi6.8.0-1028.32UBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-riscv6.8.0-60.63.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-riscv-6.86.8.0-62.65~22.04.1UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2025-21664
Ubuntu:24.04:LTSlinux-xilinx6.8.0-1017.18UBUNTU-CVE-2025-21664
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1044.48UBUNTU-CVE-2025-21664

Affected products (as reported)

VendorProductVersions
Linux Linux b10ebd34cccae1b431caf1be54919aede2be7cbe – before ec037fe8c0d0f6140e3d8a49c7b29cb5582160b8b10ebd34cccae1b431caf1be54919aede2be7cbe – before cd30a3960433ec2db94b3689752fa3c5df44d649b10ebd34cccae1b431caf1be54919aede2be7cbe – before 802666a40c71a23542c43a3f87e3a2d0f4e8fe45b10ebd34cccae1b431caf1be54919aede2be7cbe – before 12771050b6d059eea096993bf2001da9da9fddffb10ebd34cccae1b431caf1be54919aede2be7cbe – before 6b305e98de0d225ccebfb225730a9f560d28ecb0b10ebd34cccae1b431caf1be54919aede2be7cbe – before cbd0d5ecfa390ac29c5380200147d09c381b2ac6b10ebd34cccae1b431caf1be54919aede2be7cbe – before 80f130bfad1dab93b95683fc39b87235682b8f72
Linux Linux 3.15

References