CVE-2025-38492

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.
CVSS

No CVSS.

Configurations

No configuration.

History

29 Jul 2025, 14:14

Type Values Removed Values Added
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: netfs: Corregir la ejecución entre la finalización de la escritura en caché 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ón de emisión. Al final de la función de emisión, establecemos NETFS_RREQ_ALL_QUEUED para indicar al recolector que no vamos a emitir más subsolicitudes y que puede realizar las notificaciones finales y la limpieza. Ahora bien, esto no es un problema si la solicitud es sincrónica (NETFS_RREQ_OFFLOAD_COLLECTION no está establecido), ya que la recopilación de resultados se realizará en el subproceso y se nos garantiza una oportunidad para ejecutar el recolector. Sin embargo, si la solicitud es asincrónica, la recopilación se activa principalmente al finalizar las subsolicitudes que la ponen en cola en una cola de trabajo. Ahora bien, aquí puede producirse una ejecución si el subproceso de la aplicación establece ALL_QUEUED después de que finalice la última subsolicitud. Esto se puede lograr más fácilmente con el código copy2cache (usado por Ceph), donde, en la rutina de recopilación de una solicitud de lectura, se genera una solicitud de escritura asíncrona para copiar datos a la caché. 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ás eventos y la recopilación nunca se realiza, dejando la solicitud colgada. Para solucionar esto, ponga en cola el recopilador después de configurar ALL_QUEUED. Esto es un poco forzado y podría ser suficiente si no existen subsolicitudes. También agregue un punto de seguimiento para realizar una referencia cruzada de ambas solicitudes en una operación de copia a solicitud y agregue un seguimiento al punto de seguimiento netfs_rreq para indicar la configuración de ALL_QUEUED.

28 Jul 2025, 12:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-07-28 12:15

Updated : 2025-07-29 14:14


NVD link : CVE-2025-38492

Mitre link : CVE-2025-38492

CVE.ORG link : CVE-2025-38492


JSON object : View

Products Affected

No product.

CWE

No CWE.