CVE-2026-142798

Source
https://cve.org/CVERecord?id=CVE-2026-142798
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142798.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-142798
Downstream
Published
2026-12-03T03:11:29Z
Modified
2026-12-03T05:00:29Z
Summary
iomap: don't resubmit an ioend after ->writeback_submit() failed
Details

In the Linux kernel, the following vulnerability has been resolved:

iomap: don't resubmit an ioend after ->writeback_submit() failed

iomap_add_to_ioend() submits the pending ioend through ->writeback_submit() before allocating a new one for the current range. When the submission fails the helper completes the ioend with an error, but iomap_add_to_ioend() returns the error without clearing wpc->wb_ctx. iomap_writepages() then submits whatever wpc->wb_ctx points to, so the already completed ioend is submitted a second time.

For XFS the second bio_endio() lands in xfs_end_bio(), which list_add_tail()s the already linked ioend into ip->i_ioend_list. This corrupts the list and leaves a use-after-free/double-free window against the ioend completion worker. Reproduced with a fault-injected ->writeback_submit() failure on a reflinked XFS file with several CoW writeback ranges in flight: the unfixed kernel hits repeated "list_add double add" warnings from __list_add_valid_or_report(), the fixed kernel fails writeback cleanly.

Clear wpc->wb_ctx when ->writeback_submit() fails. The old iomap_submit_ioend() cleared the context unconditionally; that clear was lost when submission moved to iomap_ioend_writeback_submit(). The final ->writeback_submit() call in iomap_writepages() needs no equivalent fix: it is the last thing the function does before returning, and every caller allocates its iomap_writepage_ctx on the stack for a single call, so wpc->wb_ctx is never read again afterwards.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142798.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
f4fa7981fa26c664cc540cbce9bcb7ffe02a8912
Fixed
35096f62ca37ef7d929c89c35938372f365aad25
Fixed
212557010f57ae2b2b376e09dc2de1880f56dbc9
Fixed
3f517370076f1fedaa38cd8c78ceb73616b79336

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142798.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.17.0
Fixed
6.18.61
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.3.2

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142798.json"