CVE-2025-21712: md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime
In the Linux kernel, the following vulnerability has been resolved:
md/md-bitmap: Synchronize bitmapgetstats() with bitmap lifetime
After commit ec6bb299c7c3 ("md/md-bitmap: add 'syncsize' into struct mdbitmapstats"), following panic is reported:
Oops: general protection fault, probably for non-canonical address RIP: 0010:bitmapgetstats+0x2b/0xa0 Call Trace: <TASK> mdseqshow+0x2d2/0x5b0 seqreaditer+0x2b9/0x470 seqread+0x12f/0x180 procregread+0x57/0xb0 vfsread+0xf6/0x380 ksysread+0x6c/0xf0 dosyscall64+0x82/0x170 entrySYSCALL64afterhwframe+0x76/0x7e
Root cause is that bitmapgetstats() can be called at anytime if mddev is still there, even if bitmap is destroyed, or not fully initialized. Deferenceing bitmap in this case can crash the kernel. Meanwhile, the above commit start to deferencing bitmap->storage, make the problem easier to trigger.
Fix the problem by protecting bitmapgetstats() with bitmapinfo.mutex.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel (md/md-bitmap)to a version that resolves this vulnerability.Patch ec6bb299c7c3 - Configuration
Protect bitmap_get_stats() with bitmap_info.mutex to synchronize it with bitmap lifetime (md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime).
md/md-bitmap bitmap_get_stats() bitmap_info.mutex = protected/locked around bitmap_get_stats()
Event History
Frequently Asked Questions
What is the severity of CVE-2025-21712?
CVE-2025-21712 is classified as a medium severity vulnerability in the Linux kernel.
How do I fix CVE-2025-21712?
To fix CVE-2025-21712, update your Linux kernel to the latest patched version.
What software is affected by CVE-2025-21712?
CVE-2025-21712 affects the Linux kernel, specifically in the md/md-bitmap functionality.
What type of vulnerability is CVE-2025-21712?
CVE-2025-21712 is a general protection fault vulnerability that can lead to system crashes.
What is the impact of CVE-2025-21712?
The impact of CVE-2025-21712 may include system instability and potential denial of service due to kernel panics.