Junglewise Threat Intelligence

CVE-2025-21712: Linux Kernel md-bitmap race condition in bitmap_get_stats

CVE-2025-21712 · Severity: medium · CVSS 5.5 · Published 2025-02-27

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability in the Linux kernel's Multiple Device (MD) driver could allow a local user to crash the system. The issue occurs when the system attempts to retrieve statistics for a RAID storage device while its internal tracking bitmap is being modified or destroyed. This can lead to a kernel panic, resulting in a complete system outage and loss of availability.

Technical details

A race condition exists in the Linux kernel's md-bitmap component due to improper synchronization between bitmap_get_stats() and the bitmap's lifecycle. The function bitmap_get_stats() can be invoked via md_seq_show (e.g., reading /proc/mdstat) even if the bitmap is destroyed or not fully initialized. This leads to a null pointer dereference or general protection fault when the kernel attempts to access bitmap->storage. The vulnerability is triggered locally by reading MD device status. The fix introduces mutex protection using bitmap_info.mutex to ensure the bitmap remains valid during statistics retrieval.

Affected products

  • Linux Linux Kernel 2.6.13 to 6.1.130, 6.2 to 6.6.80, 6.7 to 6.12.13, 6.13 to 6.13.2

Timeline

  • 2025-01-24: patched: Initial patch submitted by Yu Kuai
  • 2025-02-26: advisory: CVE-2025-21712 published by kernel.org
  • 2025-02-27: disclosed: NVD publication date

References

Related threats