CVE-2025-21664
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
21/01/2025
Last modified:
03/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
dm thin: make get_first_thin use rcu-safe list first function<br />
<br />
The documentation in rculist.h explains the absence of list_empty_rcu()<br />
and cautions programmers against relying on a list_empty() -><br />
list_first() sequence in RCU safe code. This is because each of these<br />
functions performs its own READ_ONCE() of the list head. This can lead<br />
to a situation where the list_empty() sees a valid list entry, but the<br />
subsequent list_first() sees a different view of list head state after a<br />
modification.<br />
<br />
In the case of dm-thin, this author had a production box crash from a GP<br />
fault in the process_deferred_bios path. This function saw a valid list<br />
head in get_first_thin() but when it subsequently dereferenced that and<br />
turned it into a thin_c, it got the inside of the struct pool, since the<br />
list was now empty and referring to itself. The kernel on which this<br />
occurred printed both a warning about a refcount_t being saturated, and<br />
a UBSAN error for an out-of-bounds cpuid access in the queued spinlock,<br />
prior to the fault itself. When the resulting kdump was examined, it<br />
was possible to see another thread patiently waiting in thin_dtr&#39;s<br />
synchronize_rcu.<br />
<br />
The thin_dtr call managed to pull the thin_c out of the active thins<br />
list (and have it be the last entry in the active_thins list) at just<br />
the wrong moment which lead to this crash.<br />
<br />
Fortunately, the fix here is straight forward. Switch get_first_thin()<br />
function to use list_first_or_null_rcu() which performs just a single<br />
READ_ONCE() and returns NULL if the list is already empty.<br />
<br />
This was run against the devicemapper test suite&#39;s thin-provisioning<br />
suites for delete and suspend and no regressions were observed.
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 3.15.1 (including) | 5.4.290 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.234 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.177 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 6.1.125 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.72 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.12.10 (excluding) |
| cpe:2.3:o:linux:linux_kernel:3.15:-:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:3.15:rc4:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:3.15:rc5:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:3.15:rc6:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:3.15:rc7:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:3.15:rc8:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.13:rc3:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/12771050b6d059eea096993bf2001da9da9fddff
- https://git.kernel.org/stable/c/6b305e98de0d225ccebfb225730a9f560d28ecb0
- https://git.kernel.org/stable/c/802666a40c71a23542c43a3f87e3a2d0f4e8fe45
- https://git.kernel.org/stable/c/80f130bfad1dab93b95683fc39b87235682b8f72
- https://git.kernel.org/stable/c/cbd0d5ecfa390ac29c5380200147d09c381b2ac6
- https://git.kernel.org/stable/c/cd30a3960433ec2db94b3689752fa3c5df44d649
- https://git.kernel.org/stable/c/ec037fe8c0d0f6140e3d8a49c7b29cb5582160b8
- https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html
- https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html



