CVE-2026-89640
massloff_t underflow in Linux kernel CIFS remap_file_range allows local data corruption
The Linux kernel's CIFS/SMB client contains a signed 64-bit length (loff_t) underflow in cifs_remap_file_range(), the code path used when userspace clones or copies a file range on a mounted CIFS share. When a clone request specifies len == 0 (meaning 'duplicate to end of file'), the kernel computes the effective length as the source file's size minus the requested offset; if that offset lies beyond the file's size, the value goes negative, which corrupts the ByteCount of the FSCTL_DUPLICATE_EXTENTS_TO_FILE command sent to the SMB server and inverts the range passed to filemap_write_and_wait_range(), with a time-of-check/time-of-use gap and a possible torn 32-bit read of the file size aggravating the bug. Any local unprivileged user on a machine with a CIFS mount can trigger it via an ordinary copy_file_range()/remap-style syscall, causing high integrity and availability impact (corrupted data in the destination file and potential client misbehavior) but no confidentiality impact, reflected in the local-vector CVSS 3.1 score of 7.1. The fix snapshots i_size_read() once for both the bounds check and the length calculation, rejects offsets greater than the source size with -EINVAL, and treats an offset equal to the source size as a no-op. No public proof-of-concept or real-world exploitation is known, and the issue is not on CISA's KEV list.
What to do: Apply kernel updates from your distribution that include the upstream cifs fix (the commit that snapshots i_size_read() once and returns -EINVAL for off > src_size, tracked as CVE-2026-89640 in Ubuntu, Red Hat, Debian, and SUSE advisories). Until patched, restrict unprivileged local accounts on multi-user hosts that mount CIFS/SMB shares, since the attack vector is local with low privileges required. Watch for copy_file_range()/clone operations against CIFS-mounted files with offsets beyond end-of-file as a sign of tampering attempts.
| Linux (kernel.org) Linux kernel, CIFS/SMB client (cifs_remap_file_range in the cifs filesystem code) | — |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
In the Linux kernel, the following vulnerability has been resolved: cifs: fix loff_t underflow in cifs_remap_file_range() when len == 0 With len == 0 (clone to EOF), the effective length is computed as: len = src_inode->i_size - off; If off > i_size, this is a negative loff_t, corrupting the ByteCount in the FSCTL_DUPLICATE_EXTENTS_TO_FILE request and inverting the range in filemap_write_and_wait_range(). The existing off >= i_size check fires only after the ioctl has already been sent. Snapshot i_size_read() once for both the bounds check and the length calculation, eliminating the TOCTOU and 32-bit torn-read risk. Reject off > src_size with -EINVAL. Treat off == src_size as a no-op, consistent with __generic_remap_file_range_prep().
- Vector
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
In the news0 stories
No ingested article mentions this CVE yet.