CVE-2025-38492: netfs: Fix race between cache write completion and ALL_QUEUED being set
In the Linux kernel, the following vulnerability has been resolved:
netfs: Fix race between cache write completion and ALLQUEUED being set
When netfslib is issuing subrequests, the subrequests start processing immediately and may complete before we reach the end of the issuing function. At the end of the issuing function we set NETFSRREQALLQUEUED to indicate to the collector that we aren't going to issue any more subreqs and that it can do the final notifications and cleanup.
Now, this isn't a problem if the request is synchronous (NETFSRREQOFFLOADCOLLECTION is unset) as the result collection will be done in-thread and we're guaranteed an opportunity to run the collector.
However, if the request is asynchronous, collection is primarily triggered by the termination of subrequests queuing it on a workqueue. Now, a race can occur here if the app thread sets ALLQUEUED after the last subrequest terminates.
This can happen most easily with the copy2cache code (as used by Ceph) where, in the collection routine of a read request, an asynchronous write request is spawned to copy data to the cache. Folios are added to the write request as they're unlocked, but there may be a delay before ALLQUEUED is set as the write subrequests may complete before we get there.
If all the write subreqs have finished by the ALLQUEUED point, no further events happen and the collection never happens, leaving the request hanging.
Fix this by queuing the collector after setting ALLQUEUED. This is a bit heavy-handed and it may be sufficient to do it only if there are no extant subreqs.
Also add a tracepoint to cross-reference both requests in a copy-to-request operation and add a trace to the netfsrreq tracepoint to indicate the setting of ALLQUEUED.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linux-aws-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-1017.17~24.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-1017.17~24.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-1020.21~24.04.1 - Upgrade
Upgrade
ubuntu/linux-oem-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-1016.16 - Upgrade
Upgrade
ubuntu/linux-oracle-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-1017.17~24.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-36.36.1~24.04.1 - Upgrade
Upgrade
ubuntu/linux-realtime-6.14to a version that resolves this vulnerability.Fixed in 6.14.0-1016.16~24.04.1 - Compensating control
Queue the collector after setting NETFS_RREQ_ALL_QUEUED so collection performs the final notifications and cleanup even when all write subrequests have already completed.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38492?
CVE-2025-38492 has been rated as a medium severity vulnerability due to potential race conditions.
How do I fix CVE-2025-38492?
To fix CVE-2025-38492, updating to the latest version of the Linux kernel that addresses the vulnerability is recommended.
Which systems are affected by CVE-2025-38492?
CVE-2025-38492 affects various versions of the Linux kernel that utilize the netfs module.
What type of vulnerability is CVE-2025-38492?
CVE-2025-38492 is a race condition vulnerability in the netfs subsystem of the Linux kernel.
Is CVE-2025-38492 under active exploitation?
There are currently no known active exploits specifically targeting CVE-2025-38492.