HIGH Introduced in 5.14
smb Fallocate Corruption
CVE-2026-98684
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
01Description
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.
02KernelScan AI Analysis
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.
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.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 5.10.50 | 5.11 | 6787575545cd |
| 5.12 | 5.12.17 | 5.13 | f82242fe3109 |
| 5.13 | 5.13.2 | 5.14 | bf84e44ff0ed |
| 6.12 | 5.14 | 6.12.117 | aa994489bd83 |
| 6.18 | 5.14 | 6.18.56 | — |
| 7.2 | 5.14 | 7.2.10 | — |
| mainline | 5.14 | 7.3 | — |
| cip/6.12 | 5.14 | 6.12.117-cip35 | 6787575545cd |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.117-cip35 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |