In the Linux kernel, the following vulnerability has been resolved:
md: Fix missing release of 'active_io' for flush
submitflushes atomicset(&mddev->flushpending, 1); rdevforeachrcu(rdev, mddev) atomicinc(&mddev->flushpending); bi->biendio = mdendflush submitbio(bi); /* flush io is done first */ mdendflush if (atomicdecandtest(&mddev->flushpending)) percpurefput(&mddev->activeio) -> active_io is not released
if (atomicdecandtest(&mddev->flushpending)) -> missing release of active_io
For consequence, mddevsuspend() will wait for 'activeio' to be zero forever.
Fix this problem by releasing 'activeio' in submitflushes() if 'flush_pending' is decreased to zero.