CVE-2026-138817

Source
https://cve.org/CVERecord?id=CVE-2026-138817
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-138817.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-138817
Downstream
Published
2026-11-30T13:25:15Z
Modified
2026-11-30T15:01:07Z
Summary
iomap: don't lose a fiemap iteration error when emitting the last extent
Details

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

iomap: don't lose a fiemap iteration error when emitting the last extent

iomap_fiemap() emits extents one behind: iomap_fiemap_iter() flushes the previous extent and remembers the current one, and the remembered extent is written with FIEMAP_EXTENT_LAST after the iteration loop.

That final flush overwrites ret, so when ->iomap_begin() fails partway through the iteration the error is replaced by the result of iomap_to_fiemap() (zero on success) and iomap_fiemap() returns success with a truncated extent list whose last entry is wrongly marked as the last extent in the file. The pre-iomap_iter code returned the error from inside the loop, before flushing the pending extent.

Check for the iteration error before flushing the pending extent, so that real errors are propagated and only a successful iteration emits the final FIEMAP_EXTENT_LAST extent. -ENOENT (no mapping) is still not an error, and the pending extent is still emitted in that case.

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/138xxx/CVE-2026-138817.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
7892386d35715d14c469ec98b6deab037e2e2232
Fixed
904e6876bb9924c8ce8eb83786c68e6404bdb042
Fixed
635bacc0c05d369a0bea6855b354aa08cc0ab690
Fixed
29d93cc25328ec27d34098c722ef837778612dd7
Fixed
512d832beec8d2487e058befb90258e2bce89319
Fixed
d6c4a5d2cc6ad695bdc89ce6ac028eac17484b9a
Fixed
5d6f21538389fa2b9fa143afdebb4cbe170ec900
Fixed
0d0104adc2c8316433b660cdf6d182a09881864f

Database specific

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

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.15.0
Fixed
5.15.226
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.193
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.163
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.117
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.63
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.3.4

Database specific

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