CVE-2026-98682

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

Published Oct 18, 2026 CVSS 3.1 · 2.5 Low EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

The vulnerability originates from the SMB/CIFS client in the Linux kernel not properly synchronizing the destination file’s page cache during server‑side copy and clone operations. Because the client flushes and invalidates the target mapping incorrectly—releasing the invalidate_lock before issuing the copy‑chunk or clone ioctl—an asynchronous writeback can finish after the server operation and restore stale data, overwriting the freshly written region and corrupting the file. The flaw does not provide remote code execution or privilege escalation, but it does compromise data integrity for SMB‑managed files.

Affected Systems

Linux kernel builds that predate the patch, which add the SMB/CIFS client’s cifs_file_copychunk_range and cifs_remap_file_range paths, are affected. All kernel versions that include these routines in the SMB client are vulnerable until they are updated with the fix.

Risk and Exploitability

The CVSS score of 2.5 signals low severity, and the EPSS score of less than 1% indicates a very low probability of exploitation at this time; the vulnerability is not listed in CISA’s KEV catalog. An attacker who can perform SMB copy or clone operations against a vulnerable client can trigger the race condition and overwrite data, leading to corruption. The desired effect requires only local or network access to the SMB client and does not need special privileges or remote code execution.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that incorporates the patch fixing the SMB client page cache race condition
  • Check the kernel changelog or vendor announcement to identify the commit that addresses the cifs_file_copychunk_range and cifs_remap_file_range race conditions
  • After updating, verify that SMB file copy and clone operations no longer cause integrity issues by performing end‑to‑end test copies to remote SMB shares

Generated by OpenCVE AI on October 23, 2026 at 05:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4927-1 linux-6.12 security update
Ubuntu USN Ubuntu USN USN-9018-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9018-2 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-9019-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-9020-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-9160-1 Linux kernel (Azure) vulnerabilities
History
Type Values Removed Values Added
Weaknesses CWE-362
Type Values Removed Values Added
Weaknesses CWE-362
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
Weaknesses
  • CWE-664

    Improper Control of a Resource Through its Lifetime

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 23, 2026, 8:00 AM
Reserved
Sep 25, 2026, 10:25 AM
Status
Received
Published
Oct 18, 2026, 4:17 PM
Modified
Nov 23, 2026, 8:17 AM
Severity
Low
Public date
Oct 18, 2026, 12:00 AM