KernelScan.io

HIGH Introduced in 5.14

smb Fallocate Corruption

CVE-2026-98684

CVSS 7.2 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H

01

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.

02

Engine v0.9.0

Risk summary

Systems mounting SMB shares from Windows servers are at risk of silent data corruption when applications use fallocate() on recently written file ranges. A local user with write access to the SMB mount can trigger the bug, causing live data to be overwritten with zeros. The corruption is deterministic and reproducible under normal workloads.

Affectedfs/smb/client/smb2ops.c (SMB client)

Vulnerability analysis

The SMB client's fallocate emulation for small interior ranges queries the server for allocated ranges via FSCTL_QUERY_ALLOCATED_RANGES and zero-fills any reported holes to force block allocation. However, Windows servers do not guarantee this query is coherent with recently written data unless the client first flushes and commits that data. Without this synchronization, a write followed by an uncached read can return correct data, yet a subsequent allocated-ranges query reports the same range as a hole, causing the emulation to overwrite the live data with zeros. The fix adds a filemap invalidate lock, writes back and waits for dirty pages in the range, drains outstanding I/O, and issues an SMB2 FLUSH before querying, ensuring the server's view matches the data actually present. Any local user with write access to a file on an SMB mount against a Windows server can trigger this corruption through normal fallocate() calls.

03

BranchIntroducedFixed inPatch commit
5.105.10.505.116787575545cd
5.125.12.175.13f82242fe3109
5.135.13.25.14bf84e44ff0ed
6.125.146.12.117aa994489bd83
6.185.146.18.56—
7.25.147.2.10—
mainline5.147.3—
cip/6.125.146.12.117-cip356787575545cd

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.117-cip35
cip/6.1Affected — no CIP fix yet (latest 6.1.190-cip62)
cip/6.1-rtAffected — no CIP fix yet (latest 6.1.189-cip61-rt32)
cip/5.10Affected — no CIP fix yet (latest 5.10.272-cip79)
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.272-cip79-rt35)