CVE-2026-98684: smb: client: flush and commit data before querying allocated ranges
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
smb: client: flush and commit data before querying allocated ranges
The mode 0 / FALLOC_FL_KEEP_SIZE fallocate emulation for small interior ranges in smb3_simple_fallocate_range() issues FSCTL_QUERY_ALLOCATED_RANGES and zero-fills any sub-range the server reports as an unallocated hole, to force block allocation without changing file contents.
This is unsafe against Windows servers. Per the Win32 documentation, FSCTL_QUERY_ALLOCATED_RANGES only reports ranges that *may* contain nonzero data and is explicitly not coherent with recently written data:
"a call to FSCTL_QUERY_ALLOCATED_RANGES [after writing to a network
file] would not necessarily return a correct list of allocated regions. To ensure coherency [...] flush the data to the file"
fsx (generic/363) reproduces the resulting corruption against Windows Server 2022: a range is written, an uncached read returns the data, yet the next FSCTL_QUERY_ALLOCATED_RANGES on that range reports it as a whole hole, so the emulation overwrites live data with zeroes. A network trace confirmed the WRITE, the READ returning data and the query returning an empty range list within microseconds. Samba does not exhibit this; its query is coherent with the written data.
Write back the dirty pages, drain any outstanding I/O and issue an SMB2 FLUSH to force the server to commit the data before querying the allocated ranges, so the query reflects the data actually present.
With this, generic/363 passes against both Windows Server 2022 and Samba over 100000 fsx operations.
The Linux kernel CVE team has assigned CVE-2026-98684 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.14 with commit 966a3cb7c7db786452a87afdc3b48858fc4d4d6b and fixed in 6.18.56 with commit f82242fe3109a3ef72f429540b5bdde08fbfb0e4 Issue introduced in 5.14 with commit 966a3cb7c7db786452a87afdc3b48858fc4d4d6b and fixed in 7.2.10 with commit bf84e44ff0ed802778eafd7ecb623635379cb506 Issue introduced in 5.14 with commit 966a3cb7c7db786452a87afdc3b48858fc4d4d6b and fixed in 7.3-rc6 with commit aa994489bd835547c191827acc460192e147032d Issue introduced in 5.10.50 with commit c406bb9ece6ef63721daab106f132ff4b4234e81 Issue introduced in 5.12.17 with commit 2f9f4a2d0e6fcf0673ed51195e06e47abe966900 Issue introduced in 5.13.2 with commit 5e397c943424de94879830e72c95f2679e297a76
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-98684
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/smb/client/smb2ops.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/f82242fe3109a3ef72f429540b5bdde08fbfb0e4 https://git.kernel.org/stable/c/bf84e44ff0ed802778eafd7ecb623635379cb506 https://git.kernel.org/stable/c/aa994489bd835547c191827acc460192e147032d