CVE-2025-38492 (GCVE-0-2025-38492)
Vulnerability from cvelistv5
Published
2025-07-28 11:22
Modified
2025-07-28 11:22
Severity ?
VLAI Severity ?
EPSS score ?
Summary
In the Linux kernel, the following vulnerability has been resolved:
netfs: Fix race between cache write completion and ALL_QUEUED 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 NETFS_RREQ_ALL_QUEUED
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
(NETFS_RREQ_OFFLOAD_COLLECTION 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 ALL_QUEUED 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
ALL_QUEUED is set as the write subrequests may complete before we get
there.
If all the write subreqs have finished by the ALL_QUEUED point, no further
events happen and the collection never happens, leaving the request
hanging.
Fix this by queuing the collector after setting ALL_QUEUED. 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 netfs_rreq tracepoint to indicate the
setting of ALL_QUEUED.
References
Impacted products
{ "containers": { "cna": { "affected": [ { "defaultStatus": "unaffected", "product": "Linux", "programFiles": [ "fs/netfs/read_pgpriv2.c", "include/trace/events/netfs.h" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "lessThan": "110188a13c4853bd4c342e600ced4dfd26c3feb5", "status": "affected", "version": "e2d46f2ec332533816417b60933954173f602121", "versionType": "git" }, { "lessThan": "89635eae076cd8eaa5cb752f66538c9dc6c9fdc3", "status": "affected", "version": "e2d46f2ec332533816417b60933954173f602121", "versionType": "git" } ] }, { "defaultStatus": "affected", "product": "Linux", "programFiles": [ "fs/netfs/read_pgpriv2.c", "include/trace/events/netfs.h" ], "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "vendor": "Linux", "versions": [ { "status": "affected", "version": "6.14" }, { "lessThan": "6.14", "status": "unaffected", "version": "0", "versionType": "semver" }, { "lessThanOrEqual": "6.15.*", "status": "unaffected", "version": "6.15.8", "versionType": "semver" }, { "lessThanOrEqual": "*", "status": "unaffected", "version": "6.16", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "cpeMatch": [ { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.15.8", "versionStartIncluding": "6.14", "vulnerable": true }, { "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionEndExcluding": "6.16", "versionStartIncluding": "6.14", "vulnerable": true } ], "negate": false, "operator": "OR" } ] } ], "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetfs: Fix race between cache write completion and ALL_QUEUED being set\n\nWhen netfslib is issuing subrequests, the subrequests start processing\nimmediately and may complete before we reach the end of the issuing\nfunction. At the end of the issuing function we set NETFS_RREQ_ALL_QUEUED\nto indicate to the collector that we aren\u0027t going to issue any more subreqs\nand that it can do the final notifications and cleanup.\n\nNow, this isn\u0027t a problem if the request is synchronous\n(NETFS_RREQ_OFFLOAD_COLLECTION is unset) as the result collection will be\ndone in-thread and we\u0027re guaranteed an opportunity to run the collector.\n\nHowever, if the request is asynchronous, collection is primarily triggered\nby the termination of subrequests queuing it on a workqueue. Now, a race\ncan occur here if the app thread sets ALL_QUEUED after the last subrequest\nterminates.\n\nThis can happen most easily with the copy2cache code (as used by Ceph)\nwhere, in the collection routine of a read request, an asynchronous write\nrequest is spawned to copy data to the cache. Folios are added to the\nwrite request as they\u0027re unlocked, but there may be a delay before\nALL_QUEUED is set as the write subrequests may complete before we get\nthere.\n\nIf all the write subreqs have finished by the ALL_QUEUED point, no further\nevents happen and the collection never happens, leaving the request\nhanging.\n\nFix this by queuing the collector after setting ALL_QUEUED. This is a bit\nheavy-handed and it may be sufficient to do it only if there are no extant\nsubreqs.\n\nAlso add a tracepoint to cross-reference both requests in a copy-to-request\noperation and add a trace to the netfs_rreq tracepoint to indicate the\nsetting of ALL_QUEUED." } ], "providerMetadata": { "dateUpdated": "2025-07-28T11:22:01.017Z", "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux" }, "references": [ { "url": "https://git.kernel.org/stable/c/110188a13c4853bd4c342e600ced4dfd26c3feb5" }, { "url": "https://git.kernel.org/stable/c/89635eae076cd8eaa5cb752f66538c9dc6c9fdc3" } ], "title": "netfs: Fix race between cache write completion and ALL_QUEUED being set", "x_generator": { "engine": "bippy-1.2.0" } } }, "cveMetadata": { "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "assignerShortName": "Linux", "cveId": "CVE-2025-38492", "datePublished": "2025-07-28T11:22:01.017Z", "dateReserved": "2025-04-16T04:51:24.021Z", "dateUpdated": "2025-07-28T11:22:01.017Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1", "vulnerability-lookup:meta": { "nvd": "{\"cve\":{\"id\":\"CVE-2025-38492\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-07-28T12:15:31.367\",\"lastModified\":\"2025-07-29T14:14:29.590\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnetfs: Fix race between cache write completion and ALL_QUEUED being set\\n\\nWhen netfslib is issuing subrequests, the subrequests start processing\\nimmediately and may complete before we reach the end of the issuing\\nfunction. At the end of the issuing function we set NETFS_RREQ_ALL_QUEUED\\nto indicate to the collector that we aren\u0027t going to issue any more subreqs\\nand that it can do the final notifications and cleanup.\\n\\nNow, this isn\u0027t a problem if the request is synchronous\\n(NETFS_RREQ_OFFLOAD_COLLECTION is unset) as the result collection will be\\ndone in-thread and we\u0027re guaranteed an opportunity to run the collector.\\n\\nHowever, if the request is asynchronous, collection is primarily triggered\\nby the termination of subrequests queuing it on a workqueue. Now, a race\\ncan occur here if the app thread sets ALL_QUEUED after the last subrequest\\nterminates.\\n\\nThis can happen most easily with the copy2cache code (as used by Ceph)\\nwhere, in the collection routine of a read request, an asynchronous write\\nrequest is spawned to copy data to the cache. Folios are added to the\\nwrite request as they\u0027re unlocked, but there may be a delay before\\nALL_QUEUED is set as the write subrequests may complete before we get\\nthere.\\n\\nIf all the write subreqs have finished by the ALL_QUEUED point, no further\\nevents happen and the collection never happens, leaving the request\\nhanging.\\n\\nFix this by queuing the collector after setting ALL_QUEUED. This is a bit\\nheavy-handed and it may be sufficient to do it only if there are no extant\\nsubreqs.\\n\\nAlso add a tracepoint to cross-reference both requests in a copy-to-request\\noperation and add a trace to the netfs_rreq tracepoint to indicate the\\nsetting of ALL_QUEUED.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: netfs: Corregir la ejecuci\u00f3n entre la finalizaci\u00f3n de la escritura en cach\u00e9 y el establecimiento de ALL_QUEUED Cuando netfslib emite subsolicitudes, estas empiezan a procesarse inmediatamente y pueden completarse antes de que lleguemos al final de la funci\u00f3n de emisi\u00f3n. Al final de la funci\u00f3n de emisi\u00f3n, establecemos NETFS_RREQ_ALL_QUEUED para indicar al recolector que no vamos a emitir m\u00e1s subsolicitudes y que puede realizar las notificaciones finales y la limpieza. Ahora bien, esto no es un problema si la solicitud es sincr\u00f3nica (NETFS_RREQ_OFFLOAD_COLLECTION no est\u00e1 establecido), ya que la recopilaci\u00f3n de resultados se realizar\u00e1 en el subproceso y se nos garantiza una oportunidad para ejecutar el recolector. Sin embargo, si la solicitud es asincr\u00f3nica, la recopilaci\u00f3n se activa principalmente al finalizar las subsolicitudes que la ponen en cola en una cola de trabajo. Ahora bien, aqu\u00ed puede producirse una ejecuci\u00f3n si el subproceso de la aplicaci\u00f3n establece ALL_QUEUED despu\u00e9s de que finalice la \u00faltima subsolicitud. Esto se puede lograr m\u00e1s f\u00e1cilmente con el c\u00f3digo copy2cache (usado por Ceph), donde, en la rutina de recopilaci\u00f3n de una solicitud de lectura, se genera una solicitud de escritura as\u00edncrona para copiar datos a la cach\u00e9. Los folios se agregan a la solicitud de escritura a medida que se desbloquean, pero puede haber un retraso antes de que se configure ALL_QUEUED, ya que las subsolicitudes de escritura pueden completarse antes de que lleguemos a ese punto. Si todas las subsolicitudes de escritura han finalizado para el punto ALL_QUEUED, no ocurren m\u00e1s eventos y la recopilaci\u00f3n nunca se realiza, dejando la solicitud colgada. Para solucionar esto, ponga en cola el recopilador despu\u00e9s de configurar ALL_QUEUED. Esto es un poco forzado y podr\u00eda ser suficiente si no existen subsolicitudes. Tambi\u00e9n agregue un punto de seguimiento para realizar una referencia cruzada de ambas solicitudes en una operaci\u00f3n de copia a solicitud y agregue un seguimiento al punto de seguimiento netfs_rreq para indicar la configuraci\u00f3n de ALL_QUEUED.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/110188a13c4853bd4c342e600ced4dfd26c3feb5\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/89635eae076cd8eaa5cb752f66538c9dc6c9fdc3\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}" } }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…
Loading…