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

smb: client: drain and invalidate before server-side copy/clone

cifs_file_copychunk_range() and the clone (FICLONE) path of
cifs_remap_file_range() do not serialise the destination page cache
against the server-side copy the way the other server-side range
operations (smb3_zero_range(), smb3_punch_hole(), smb3_collapse_range()
and smb3_insert_range()) do.

cifs_file_copychunk_range() invalidates the destination range with
filemap_invalidate_inode(), which takes and drops the mapping's
invalidate_lock internally, so the lock is no longer held when the
copychunk ioctl is issued. It also never drains in-flight netfs I/O on
the target. The clone path never takes the invalidate_lock at all (only
i_rwsem), uses a bare truncate_inode_pages_range() and likewise does not
drain outstanding I/O.

As a result an asynchronous destination writeback can complete after the
server-side copy/clone has run and reinstate stale data over the region
just written by the server, corrupting the file. This is the same class
of corruption as commit d7d2adcd022b ("smb/client: flush dirty data
before punching a hole") and has been seen randomly in generic/363
against Windows Server.

Fix both paths to follow the established ordering: hold the target
mapping's invalidate_lock across the flush and invalidation of the
destination and the server ioctl, and call netfs_wait_for_outstanding_io()
on the target to drain in-flight writes before the ioctl is issued. Only
the target inode's invalidate_lock is required, as the source is merely
flushed and not invalidated; i_rwsem (already held via
lock_two_nondirectories()) is acquired before the invalidate_lock,
matching the VFS lock ordering. Since filemap_invalidate_inode() takes
that same lock internally, replace it with its own unmap/flush/invalidate
steps instead of calling it, and return early on a zero-length copy to
avoid a range underflow.
Published: 2026-10-18
Score: n/a
EPSS: n/a
KEV: No
Impact: Data corruption
Action: Apply patch
AI Analysis

Impact

The vulnerability arises from the Linux kernel’s SMB client not properly serializing the target file’s page cache during server-side copy and clone operations. Because the destination mapping’s invalidate_lock is released before the kernel issues the copy-chunk or clone ioctl, an asynchronous writeback can finish afterward and overwrite the freshly written data, restoring stale contents and corrupting the file. This flaw does not provide remote code execution or credential escalation; its primary consequence is unintended data loss and integrity compromise for files written over SMB by client systems.

Affected Systems

Linux kernel builds that include the SMB/CIFS client prior to the fix. The vendor is the Linux kernel itself, covering all affected kernel versions that implement the cifs_file_copychunk_range and cifs_remap_file_range routines.

Risk and Exploitability

No CVSS score is supplied in the public data, but the EPSS is not available and the vulnerability is not listed in the CISA KEV catalog. The flaw is exploitable on systems using the SMB/CIFS client where background writeback of the target page cache is enabled. An attacker with local or network access that can initiate SMB copy or clone operations could deliberately trigger the race condition to overwrite fresh data, leading to file corruption. The exploit requires the client to perform a range copy or clone against a server that supports the operation; no remote code execution or privilege escalation is possible.

Generated by OpenCVE AI on October 18, 2026 at 18:46 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a release that incorporates the patch fixing the SMB client page cache race condition.
  • Check the kernel changelog or vendor announcement for the commit that addresses cifs_file_copychunk_range and cifs_remap_file_range race conditions.
  • After updating, validate that SMB file copy and clone operations no longer result in integrity issues by performing test copies to remote SMB shares.

Generated by OpenCVE AI on October 18, 2026 at 18:46 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Sun, 18 Oct 2026 19:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-362

Sun, 18 Oct 2026 16:00:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: smb: client: drain and invalidate before server-side copy/clone cifs_file_copychunk_range() and the clone (FICLONE) path of cifs_remap_file_range() do not serialise the destination page cache against the server-side copy the way the other server-side range operations (smb3_zero_range(), smb3_punch_hole(), smb3_collapse_range() and smb3_insert_range()) do. cifs_file_copychunk_range() invalidates the destination range with filemap_invalidate_inode(), which takes and drops the mapping's invalidate_lock internally, so the lock is no longer held when the copychunk ioctl is issued. It also never drains in-flight netfs I/O on the target. The clone path never takes the invalidate_lock at all (only i_rwsem), uses a bare truncate_inode_pages_range() and likewise does not drain outstanding I/O. As a result an asynchronous destination writeback can complete after the server-side copy/clone has run and reinstate stale data over the region just written by the server, corrupting the file. This is the same class of corruption as commit d7d2adcd022b ("smb/client: flush dirty data before punching a hole") and has been seen randomly in generic/363 against Windows Server. Fix both paths to follow the established ordering: hold the target mapping's invalidate_lock across the flush and invalidation of the destination and the server ioctl, and call netfs_wait_for_outstanding_io() on the target to drain in-flight writes before the ioctl is issued. Only the target inode's invalidate_lock is required, as the source is merely flushed and not invalidated; i_rwsem (already held via lock_two_nondirectories()) is acquired before the invalidate_lock, matching the VFS lock ordering. Since filemap_invalidate_inode() takes that same lock internally, replace it with its own unmap/flush/invalidate steps instead of calling it, and return early on a zero-length copy to avoid a range underflow.
Title smb: client: drain and invalidate before server-side copy/clone
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-10-18T15:45:47.375Z

Reserved: 2026-09-25T10:25:14.364Z

Link: CVE-2026-98682

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-18T16:17:21.557

Modified: 2026-10-18T16:17:21.557

Link: CVE-2026-98682

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-18T19:00:11Z

Weaknesses
  • CWE-362

    Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')