CVE-2026-72438: md/raid10: fix writes_pending and barrier reference leaks on discard failures
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
md/raid10: fix writes_pending and barrier reference leaks on discard failures
raid10_make_request() acquires a writes_pending reference with md_write_start() before calling raid10_handle_discard(). Several failure paths in raid10_handle_discard() complete the bio and return without releasing the corresponding reference, causing md_write_end() to be skipped.
Call md_write_end() before returning from these failure paths to keep writes_pending accounting balanced.
Additionally, discard split allocation failures can occur after wait_barrier() succeeds. Those paths return without calling allow_barrier(), leaking the associated barrier reference.
Release the barrier before returning from those paths.
The Linux kernel CVE team has assigned CVE-2026-72438 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.17 with commit c9aa889b035fca4598ae985a0f0c76ebbb547ad2 and fixed in 7.1.5 with commit d1324b41dabd26787559efaeb430643c627c1eb0 Issue introduced in 5.17 with commit c9aa889b035fca4598ae985a0f0c76ebbb547ad2 and fixed in 7.2-rc1 with commit 393d687131d8aa8c7e4de2cb494438e145d20fc2 Issue introduced in 5.15.111 with commit 39db562b3fedb93978a7e42dd216b306740959f8
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-72438
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/md/raid10.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/d1324b41dabd26787559efaeb430643c627c1eb0 https://git.kernel.org/stable/c/393d687131d8aa8c7e4de2cb494438e145d20fc2