In the Linux kernel, the following vulnerability has been resolved:
md/raid1: fix writes_pending and barrier reference leaks on write failures
raid1makerequest() acquires a writespending reference with mdwritestart() before calling raid1writerequest(). Several failure paths in raid1writerequest() complete the bio and return without reaching the normal write completion path, causing the corresponding mdwrite_end() to be skipped.
Make raid1writerequest() return a status indicating whether the write request was successfully queued. This allows raid1makerequest() to call mdwriteend() when raid1writerequest() fails.
Additionally, if waitblockedrdev() fails after wait_barrier() succeeds, the associated barrier reference is not released.
Call allow_barrier() before returning from that path to keep the barrier accounting balanced.