5.5medium
netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.18% (higher than 7% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled When the caching for a cookie is temporarily disabled (e.g. due to a DIO write on that file), future copying to the cache for that file is disabled until all fds open on that file are closed. However, if netfslib is using the deprecated PG_private_2 method (such as is currently used by ceph), and decides it wants to copy to the cache, netfs_advance_write() will just bail at the first check seeing that the cache stream is unavailable, and indicate that it dealt with all the content. This means that we have no subrequests to provide notifications to drive the state machine or even to pin the request and the request just gets discarded, leaving the folios with PG_private_2 set. Fix this by jumping directly to cancel the request if the cache is not available. That way, we don't remove mark3 from the folio_queue list and netfs_pgpriv2_cancel() will clean up the folios. This was found by running the generic/013 xfstest against ceph with an active cache and the "-o fsc" option passed to ceph. That would usually hang
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from ee4cdf7ba857a894ad1650d6ab77669cbbfa329e before ba37bdfe59fb43e80dd79290340a21864ba4b61e, from ee4cdf7ba857a894ad1650d6ab77669cbbfa329e before d0327c824338cdccad058723a31d038ecd553409, 6.12 Not affected: before 6.12, from 6.12.10 up to 6.12.*, from 6.13 up to * | CVE List |
| linux linux_kernel | from 6.12 before 6.12.10, 6.13 | NVD |
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: netfs: Fix the (non-)cancellation of copy when cache is temporarily disabled When the caching for a cookie is temporarily disabled (e.g. due to a DIO write on that file), future copying to the cache for that file is disabled until all fds open on that file are closed. However, if netfslib is using the deprecated PG_private_2 method (such as is currently used by ceph), and decides it wants to copy to the cache, netfs_advance_write() will just bail at the first check seeing that the cache stream is unavailable, and indicate that it dealt with all the content. This means that we have no subrequests to provide notifications to drive the state machine or even to pin the request and the request just gets discarded, leaving the folios with PG_private_2 set. Fix this by jumping directly to cancel the request if the cache is not available. That way, we don't remove mark3 from the folio_queue list and netfs_pgpriv2_cancel() will clean up the folios. This was found by running the generic/013 xfstest against ceph with an active cache and the "-o fsc" option passed to ceph. That would usually hang
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: netfs: Arreglar la (no) cancelación de copia cuando el caché está deshabilitado temporalmente Cuando el almacenamiento en caché de una cookie está deshabilitado temporalmente (por ejemplo, debido a una escritura DIO en ese archivo), la copia futura al caché para ese archivo se deshabilita hasta que todos los fds abiertos en ese archivo se cierren. Sin embargo, si netfslib está usando el método PG_private_2 obsoleto (como el que usa actualmente ceph) y decide que quiere copiar al caché, netfs_advance_write() simplemente abandonará en la primera verificación al ver que el flujo de caché no está disponible e indicará que se ocupó de todo el contenido. Esto significa que no tenemos subsolicitudes para proporcionar notificaciones para controlar la máquina de estado o incluso para fijar la solicitud y la solicitud simplemente se descarta, dejando los folios con PG_private_2 establecido. Arregle esto saltando directamente para cancelar la solicitud si el caché no está disponible. De esa manera, no eliminamos mark3 de la lista folio_queue y netfs_pgpriv2_cancel() limpiará los folios. Esto se descubrió al ejecutar el xfstest genérico/013 contra ceph con un caché activo y la opción "-o fsc" pasada a ceph. Eso generalmente se bloqueaba
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-57941 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2024-57941 changed 2026-06-17 | Public domain |