md/bitmap: fix GPF in write_page caused by resize race
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d60b479d177a5735b6b4db6ee5280ef6653f50e7 · < 9a6f8cd28bb9bb6ed86a6df19331fb08016dee7f| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
md/bitmap: fix GPF in write_page caused by resize race
A General Protection Fault occurs in write_page() during array resize: RIP: 0010:write_page+0x22b/0x3c0 [md_mod]
This is a use-after-free race between bitmap_daemon_work() and __bitmap_resize(). The daemon iterates over `bitmap->storage.filemap` without locking, while the resize path frees that storage via md_bitmap_file_unmap(). `quiesce()` does not stop the md thread, allowing concurrent access to freed pages.
Fix by holding `mddev->bitmap_info.mutex` during the bitmap update.
From the CVE record · Linux
A use-after-free race in the Linux kernel's md bitmap code can cause a General Protection Fault when bitmap daemon work overlaps an array resize. The input does not specify an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels that use md bitmaps should check their versions; affected versions are not specified.