In the Linux kernel, the following vulnerability has been resolved:
md raid: fix hang when stopping arrays with metadata through dm-raid
When using device-mapper's dm-raid target, stopping a RAID array can cause the system to hang under specific conditions.
This occurs when:
- A dm-raid managed device tree is suspended from top to bottom
- The top-level RAID device is then removed
Removing the top-level device triggers a hang in the following sequence: the dm-raid destructor calls md_stop(), which tries to flush the write-intent bitmap by writing to the metadata sub-devices. However, these devices are already suspended, making them unable to complete the write-intent operations and causing an indefinite block.
Fix:
- Prevent bitmap flushing when md_stop() is called from dm-raid
- Still allow write-intent bitmap flushing when called from dm-raid
This ensures that RAID array teardown can complete successfully even when the underlying devices are in a suspended state.
This second patch uses md_is_rdwr() to distinguish between suspend and destructor paths as elaborated on above.