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

Published Jan 21, 2025
·
Updated

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

dm thin: make getfirstthin use rcu-safe list first function

The documentation in rculist.h explains the absence of listemptyrcu() and cautions programmers against relying on a listempty() -> listfirst() sequence in RCU safe code. This is because each of these functions performs its own READONCE() of the list head. This can lead to a situation where the listempty() sees a valid list entry, but the subsequent listfirst() 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 processdeferredbios path. This function saw a valid list head in getfirstthin() but when it subsequently dereferenced that and turned it into a thinc, 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 refcountt 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 thindtr's synchronizercu.

The thindtr call managed to pull the thinc out of the active thins list (and have it be the last entry in the activethins list) at just the wrong moment which lead to this crash.

Fortunately, the fix here is straight forward. Switch getfirstthin() function to use listfirstornullrcu() which performs just a single READONCE() 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.

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

21 affected componentsFixes available
Linux Linux kernel
debian/linux<=5.10.223-1
5.10.234-16.1.129-16.1.135-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1
Linux Linux kernel>=3.15.1<5.4.290
Linux Linux kernel>=5.5<5.10.234
Linux Linux kernel>=5.11<5.15.177
Linux Linux kernel>=5.16<6.1.125
Linux Linux kernel>=6.2<6.6.72
Linux Linux kernel>=6.7<6.12.10
Linux Linux kernel=3.15
Linux Linux kernel=3.15-rc4
Linux Linux kernel=3.15-rc5
Linux Linux kernel=3.15-rc6
Linux Linux kernel=3.15-rc7
Linux Linux kernel=3.15-rc8
Linux Linux kernel=6.13-rc1
Linux Linux kernel=6.13-rc2
Linux Linux kernel=6.13-rc3
Linux Linux kernel=6.13-rc4
Linux Linux kernel=6.13-rc5
Linux Linux kernel=6.13-rc6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.27-1
  2. Upgrade

    Upgrade debian/linux-6.1 to a version that resolves this vulnerability.

    Fixed in 6.1.129-1~deb11u1

Event History

Jan 21, 2025
CVE Published
via MITRE·12:18 PM
Data Sourced
via MITRE·12:18 PM
DescriptionSeverity
Data Sourced
via NVD·01:15 PM
Description
Data Sourced
via NVD·01:15 PM
RemedySeverityAffected Software
Mar 31, 2025
Data Sourced
via Launchpad·06:52 PM
Description
May 14, 2025
Data Sourced
via Ubuntu·07:00 PM
RemedyDescriptionSeverityAffected Software
Oct 29, 58546
Event
via MITRE·06:41 AM

Frequently Asked Questions

1

What is the severity of CVE-2025-21664?

CVE-2025-21664 is classified as a moderate severity vulnerability in the Linux kernel.

2

How do I fix CVE-2025-21664?

To fix CVE-2025-21664, update the Linux kernel to the latest version that contains the security patch.

3

What components of the Linux kernel are affected by CVE-2025-21664?

CVE-2025-21664 affects the dm thin component of the Linux kernel.

4

Is CVE-2025-21664 being exploited in the wild?

As of now, there have been no confirmed reports of CVE-2025-21664 being actively exploited in the wild.

5

Where can I find more information about CVE-2025-21664?

Detailed technical information about CVE-2025-21664 can be found in the Linux kernel's commit history.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203