CVE-2026-138817: iomap: don't lose a fiemap iteration error when emitting the last extent

Published Nov 30, 2026
·
Updated

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

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

iomapfiemap() emits extents one behind: iomapfiemapiter() flushes the previous extent and remembers the current one, and the remembered extent is written with FIEMAPEXTENTLAST after the iteration loop.

That final flush overwrites ret, so when ->iomapbegin() fails partway through the iteration the error is replaced by the result of iomaptofiemap() (zero on success) and iomapfiemap() returns success with a truncated extent list whose last entry is wrongly marked as the last extent in the file. The pre-iomapiter 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 FIEMAPEXTENTLAST extent. -ENOENT (no mapping) is still not an error, and the pending extent is still emitted in that case.

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In iomap_fiemap(), check for an iteration error before flushing the pending extent, so real errors are propagated and the final FIEMAP_EXTENT_LAST extent is emitted only after successful iteration.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:25 PM
Data Sourced
via MITRE·01:25 PM
Description

Frequently Asked Questions

1

When does the incorrect successful result occur?

It occurs when ->iomap_begin() fails partway through FIEMAP iteration after a previous extent has been retained for the final flush. The final extent emission can overwrite the iteration error with a successful result.

2

What is the observable effect of the error being lost?

FIEMAP can return success with a truncated extent list. The final returned entry may also be incorrectly marked with FIEMAP_EXTENT_LAST, indicating it is the last extent in the file.

3

Does a no-mapping result change under the fix?

No. -ENOENT, which indicates no mapping, remains non-error behavior, and a pending extent is still emitted in that case.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203