HIGH Introduced in 6.12
netfs RollingBuffer Race
CVE-2026-98118
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
KernelScan AI7.5HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: netfs: Fix readahead synchronisation issues by loading all folios upfront There are some synchronisation issues that derive from the app thread adding more folios to the rolling buffer whilst the collector thread is looking at them or trying to clear them, such as determining the setting of front_folio_order when the next folio hasn't been added yet, The reason for the rolling buffer approach is that loading the buffer upfront and then dropping all the refs just acquired is quite a slow operation, and loading progressively allows some of the cost to be deferred until after at least some of the I/O is started. Instead, a better way is to load all the folios into the rolling buffer upfront - and then drop the refs later, once the I/O is in progress. (Even better would be for the refs not to be there at all.) Fix this by changing the rolling buffer loader to load all the folios selected by the VM for readahead upfront into the folio queue. The folio queue is allocated a batch worth at a time as we don't know how many folios are involved (the readahead_control struct, alas, has a page count, not a folio count). The folio refs acquired from readahead are then dropped in bulk once the first subrequest is dispatched as it's quite a slow operation. The collector waits for NETFS_RREQ_NEED_PUT_RA_REFS to be cleared so that it doesn't unlock folios before the xarray has been scanned for them. This simplifies the buffer handling later and isn't noticeably slower as the xarray doesn't need to be modified and the folios are all already pre-locked.
02KernelScan AI Analysis
Risk summary
A race condition in the kernel's netfs readahead subsystem allows a local user reading files on a network filesystem (NFS, SMB/CIFS, Ceph, AFS, or 9p) to corrupt kernel memory by exploiting a timing window between the read-submission and I/O-completion threads. This can lead to kernel crashes or potential privilege escalation. Any system mounting network filesystems and allowing local file reads is at risk.
Vulnerability analysis
In the network filesystem readahead path, one thread progressively adds memory pages to a buffer while another thread simultaneously examines and clears those same entries. This creates a race where the second thread can access entries that have not been fully set up yet, or operate on the buffer in an inconsistent state, leading to kernel memory corruption or crashes. The fix changes the approach to load all selected pages into the buffer upfront before any I/O is dispatched, eliminating the race window entirely. It also introduces coordination so the collecting thread waits for readahead-acquired references to be dropped before unlocking anything, preventing the cleanup path from scanning for those pages while they are still locked. Any local user who can read files on a network filesystem such as NFS, SMB/CIFS, Ceph, AFS, or 9p can trigger this vulnerability, though exploitation requires winning a timing race between the read and I/O completion threads.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 7.2 | 6.12 | 7.2.7 | 8c9b33945712 |
| mainline | 6.12 | 7.3 | fed0b33e6c58 |
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 | Affected — no CIP fix yet (latest 6.12.118-cip136) |