{"id":"CVE-2026-142798","summary":"iomap: don't resubmit an ioend after -\u003ewriteback_submit() failed","details":"In the Linux kernel, the following vulnerability has been resolved:\n\niomap: don't resubmit an ioend after -\u003ewriteback_submit() failed\n\niomap_add_to_ioend() submits the pending ioend through\n-\u003ewriteback_submit() before allocating a new one for the current range.\nWhen the submission fails the helper completes the ioend with an error,\nbut iomap_add_to_ioend() returns the error without clearing\nwpc-\u003ewb_ctx.  iomap_writepages() then submits whatever wpc-\u003ewb_ctx\npoints to, so the already completed ioend is submitted a second time.\n\nFor XFS the second bio_endio() lands in xfs_end_bio(), which\nlist_add_tail()s the already linked ioend into ip-\u003ei_ioend_list.  This\ncorrupts the list and leaves a use-after-free/double-free window against\nthe ioend completion worker.  Reproduced with a fault-injected\n-\u003ewriteback_submit() failure on a reflinked XFS file with several\nCoW writeback ranges in flight: the unfixed kernel hits repeated\n\"list_add double add\" warnings from __list_add_valid_or_report(),\nthe fixed kernel fails writeback cleanly.\n\nClear wpc-\u003ewb_ctx when -\u003ewriteback_submit() fails.  The old\niomap_submit_ioend() cleared the context unconditionally; that clear was\nlost when submission moved to iomap_ioend_writeback_submit().  The final\n-\u003ewriteback_submit() call in iomap_writepages() needs no equivalent fix:\nit is the last thing the function does before returning, and every\ncaller allocates its iomap_writepage_ctx on the stack for a single call,\nso wpc-\u003ewb_ctx is never read again afterwards.","modified":"2026-12-03T05:00:29.106789545Z","published":"2026-12-03T03:11:29.351Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142798.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/212557010f57ae2b2b376e09dc2de1880f56dbc9"},{"type":"WEB","url":"https://git.kernel.org/stable/c/35096f62ca37ef7d929c89c35938372f365aad25"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3f517370076f1fedaa38cd8c78ceb73616b79336"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142798.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142798"}],"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"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"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"}}],"schema_version":"1.9.2"}