smb: client: discard post-EOF pagecache when extending a file via clone range
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
smb: client: discard post-EOF pagecache when extending a file via clone range
cifs_remap_file_range() discarded the pagecache only for the folios overlapping the destination region, so when a clone extends the file the folio straddling the old EOF - which may hold data dirtied past EOF through an mmap - was never dropped and became visible as file content once the file was extended.
Start the discard at the smaller of fstart and the old EOF. i_size is still old here, so nothing past the old EOF is flushed to the server.
From the CVE record · Linux
The Linux kernel SMB client did not discard a cached page straddling the old end of a file when a clone operation extended it. If data had been dirtied past the end of the file through mmap, that data could become visible as file content after the clone. The input does not specify attacker access requirements or user interaction.
Engineers running the Linux kernel SMB client should check their deployments; affected versions are not specified.