Files
linux-net/drivers/md
Jack Wang 46ef85f854 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.

Link: https://lore.kernel.org/linux-raid/20260120102456.25169-1-jinpu.wang@ionos.com
Closes: https://lore.kernel.org/linux-raid/CAMGffE=Mbfp=7xD_hYxXk1PAaCZNSEAVeQGKGy7YF9f2S4=NEA@mail.gmail.com/T/#u
Cc: stable@vger.kernel.org
Fixes: d60b479d17 ("md/bitmap: add bitmap_resize function to allow bitmap resizing.")
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
2026-01-26 13:36:06 +08:00
..
2024-04-01 11:53:37 -06:00
2025-08-19 11:12:50 +02:00
2024-02-20 14:22:51 -05:00
2025-12-10 19:28:22 +01:00
2024-11-20 11:38:04 +01:00
2025-11-05 08:07:21 -07:00
2025-01-13 07:36:29 -08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00
2026-01-26 13:17:38 +08:00