CVE-2025-21712

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-21712
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-21712.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-21712
Downstream
Related
Published
2025-02-27T02:07:24.354Z
Modified
2025-11-28T02:34:05.105198Z
Summary
md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime
Details

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 mdbitmap_stats"), 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 entrySYSCALL64after_hwframe+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 bitmap_info.mutex.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/21xxx/CVE-2025-21712.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
32a7627cf3a35396a8e834faf34e38ae9f3b1309
Fixed
032fa54f486eac5507976e7e31f079a767bc13a8
Fixed
52848a095b55a302af92f52ca0de5b3112059bb8
Fixed
237e19519c8ff6949f0ef57c4a0243f5b2b0fa18
Fixed
4e9316eee3885bfb311b4759513f2ccf37891c09
Fixed
8d28d0ddb986f56920ac97ae704cc3340a699a30

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.6.13
Fixed
6.1.130
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.80
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.13
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.13.2