CVE-2026-89640: cifs: fix loff_t underflow in cifs_remap_file_range() when len == 0

Published Sep 11, 2026
·
Updated

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

cifs: fix lofft underflow in cifsremapfilerange() when len == 0

With len == 0 (clone to EOF), the effective length is computed as:

len = srcinode->isize - off;

If off > isize, this is a negative lofft, corrupting the ByteCount in the FSCTLDUPLICATEEXTENTSTOFILE request and inverting the range in filemapwriteandwaitrange(). The existing off >= isize check fires only after the ioctl has already been sent.

Snapshot isizeread() once for both the bounds check and the length calculation, eliminating the TOCTOU and 32-bit torn-read risk. Reject off > srcsize with -EINVAL. Treat off == srcsize as a no-op, consistent with genericremapfilerangeprep().

Affected Software

1 affected component
Linux Linux kernel

Event History

Sep 11, 2026
CVE Published
via MITRE·07:45 PM
Data Sourced
via MITRE·07:45 PM
Description

Frequently Asked Questions

1

What operation and input condition trigger the flaw?

The issue is triggered in cifs_remap_file_range() when a clone-to-EOF operation uses len == 0 and the source offset is greater than the source file size. The resulting negative effective length can corrupt the ByteCount in the FSCTL_DUPLICATE_EXTENTS_TO_FILE request.

2

What happens when the source offset is exactly at EOF?

An offset equal to the source file size is treated as a no-op, consistent with __generic_remap_file_range_prep(). An offset beyond EOF is rejected with -EINVAL.

3

Why does the fix read the source size only once?

Using one i_size_read() result for both validation and length calculation prevents a time-of-check/time-of-use race. It also avoids a torn read risk on 32-bit systems.

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