netfs: zero gaps in read-gaps folio to avoid writing back stale data
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.567.2.107.3In the Linux kernel, the following vulnerability has been resolved:
netfs: zero gaps in read-gaps folio to avoid writing back stale data
netfs_read_gaps() leaves gaps around a streaming write's dirty region unread on the server side, so a short/EOF response there left stale folio content that later got written back.
Zero it after the read completes, not before: netfs_wait_for_read() returns rreq->transferred once ret >= 0, so build an iterator over the same bvec array the read used, advance past ret, and zero the rest. The dirty region already maps to sink pages in that array rather than the real folio, so this can't touch it, and only the actual shortfall gets zeroed instead of the whole gap upfront.
From the CVE record · Linux
The Linux kernel's netfs read-gaps handling can leave stale folio content in gaps around a streaming write's dirty region. If a server returns a short or end-of-file response for those gaps, the stale content can later be written back. The input does not specify attacker access or user-interaction requirements.
Engineers running the Linux kernel should check whether their version is affected; affected versions are not specified.