CVE-2026-142798: iomap: don't resubmit an ioend after ->writeback_submit() failed
In the Linux kernel, the following vulnerability has been resolved:
iomap: don't resubmit an ioend after ->writebacksubmit() failed
iomapaddtoioend() submits the pending ioend through ->writebacksubmit() before allocating a new one for the current range. When the submission fails the helper completes the ioend with an error, but iomapaddtoioend() returns the error without clearing wpc->wbctx. iomapwritepages() then submits whatever wpc->wbctx points to, so the already completed ioend is submitted a second time.
For XFS the second bioendio() lands in xfsendbio(), which listaddtail()s the already linked ioend into ip->iioendlist. This corrupts the list and leaves a use-after-free/double-free window against the ioend completion worker. Reproduced with a fault-injected ->writebacksubmit() failure on a reflinked XFS file with several CoW writeback ranges in flight: the unfixed kernel hits repeated "listadd double add" warnings from listaddvalidorreport(), the fixed kernel fails writeback cleanly.
Clear wpc->wbctx when ->writebacksubmit() fails. The old iomapsubmitioend() cleared the context unconditionally; that clear was lost when submission moved to iomapioendwritebacksubmit(). The final ->writebacksubmit() call in iomapwritepages() needs no equivalent fix: it is the last thing the function does before returning, and every caller allocates its iomapwritepagectx on the stack for a single call, so wpc->wbctx is never read again afterwards.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.61 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.2 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.3-1 - Compensating control
Clear wpc->wb_ctx when ->writeback_submit() fails so the completed ioend is not submitted a second time.
Event History
Frequently Asked Questions
Which systems are most clearly exposed to this issue?
The documented reproducer involves XFS writeback on a reflinked file with multiple copy-on-write writeback ranges in flight. The failure path corrupts XFS ioend list handling after an ioend is submitted twice.
What condition is needed to trigger the vulnerable path?
A ->writeback_submit() operation must fail while iomap is handling a pending ioend and preparing a new one. The issue was reproduced by fault-injecting that submission failure.
How might an affected system reveal the problem?
The unfixed kernel produced repeated "list_add double add" warnings from __list_add_valid_or_report(). The resulting list corruption creates a use-after-free and double-free window in the ioend completion worker.