{"id":"CVE-2026-138817","aliases":["CVE-2026-138817"],"related":[],"kind":"vulnerability","state":"published","title":"iomap: don't lose a fiemap iteration error when emitting the last extent","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\niomap: don't lose a fiemap iteration error when emitting the last extent\n\niomap_fiemap() emits extents one behind: iomap_fiemap_iter() flushes the\nprevious extent and remembers the current one, and the remembered extent\nis written with FIEMAP_EXTENT_LAST after the iteration loop.\n\nThat final flush overwrites ret, so when ->iomap_begin() fails partway\nthrough the iteration the error is replaced by the result of\niomap_to_fiemap() (zero on success) and iomap_fiemap() returns success\nwith a truncated extent list whose last entry is wrongly marked as the\nlast extent in the file.  The pre-iomap_iter code returned the error\nfrom inside the loop, before flushing the pending extent.\n\nCheck for the iteration error before flushing the pending extent, so\nthat real errors are propagated and only a successful iteration emits\nthe final FIEMAP_EXTENT_LAST extent.  -ENOENT (no mapping) is still not\nan error, and the pending extent is still emitted in that case.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\niomap: don't lose a fiemap iteration error when emitting the last extent\n\niomap_fiemap() emits extents one behind: iomap_fiemap_iter() flushes the\nprevious extent and remembers the current one, and the remembered extent\nis written with FIEMAP_EXTENT_LAST after the iteration loop.\n\nThat final flush overwrites ret, so when ->iomap_begin() fails partway\nthrough the iteration the error is replaced by the result of\niomap_to_fiemap() (zero on success) and iomap_fiemap() returns success\nwith a truncated extent list whose last entry is wrongly marked as the\nlast extent in the file.  The pre-iomap_iter code returned the error\nfrom inside the loop, before flushing the pending extent.\n\nCheck for the iteration error before flushing the pending extent, so\nthat real errors are propagated and only a successful iteration emits\nthe final FIEMAP_EXTENT_LAST extent.  -ENOENT (no mapping) is still not\nan error, and the pending extent is still emitted in that case.","source":"cvelist"}],"published":"2026-11-30T13:25:15.605Z","modified":"2026-11-30T14:17:35.623Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"7892386d35715d14c469ec98b6deab037e2e2232","fixed":"904e6876bb9924c8ce8eb83786c68e6404bdb042","status":"affected"},{"type":"git","introduced":"7892386d35715d14c469ec98b6deab037e2e2232","fixed":"635bacc0c05d369a0bea6855b354aa08cc0ab690","status":"affected"},{"type":"git","introduced":"7892386d35715d14c469ec98b6deab037e2e2232","fixed":"29d93cc25328ec27d34098c722ef837778612dd7","status":"affected"},{"type":"git","introduced":"7892386d35715d14c469ec98b6deab037e2e2232","fixed":"512d832beec8d2487e058befb90258e2bce89319","status":"affected"},{"type":"git","introduced":"7892386d35715d14c469ec98b6deab037e2e2232","fixed":"d6c4a5d2cc6ad695bdc89ce6ac028eac17484b9a","status":"affected"},{"type":"git","introduced":"7892386d35715d14c469ec98b6deab037e2e2232","fixed":"5d6f21538389fa2b9fa143afdebb4cbe170ec900","status":"affected"},{"type":"git","introduced":"7892386d35715d14c469ec98b6deab037e2e2232","fixed":"0d0104adc2c8316433b660cdf6d182a09881864f","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.15","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.117","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/904e6876bb9924c8ce8eb83786c68e6404bdb042","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/635bacc0c05d369a0bea6855b354aa08cc0ab690","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/29d93cc25328ec27d34098c722ef837778612dd7","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/512d832beec8d2487e058befb90258e2bce89319","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d6c4a5d2cc6ad695bdc89ce6ac028eac17484b9a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5d6f21538389fa2b9fa143afdebb4cbe170ec900","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0d0104adc2c8316433b660cdf6d182a09881864f","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138817","url":"https://www.cve.org/CVERecord?id=CVE-2026-138817","licence":"CVE Terms of Use","modified":"2026-11-30T13:25:15.605Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138817","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138817","licence":"Public domain","modified":"2026-11-30T14:17:35.623Z"}],"updatedAt":"2026-11-30T14:32:25.555Z","epss":{"score":0.00173,"percentile":0.07071,"date":"2026-12-01T12:00:22.000Z"}}