CVE-2025-38073

In the Linux kernel, the following vulnerability has been resolved: block: fix race between set_blocksize and read paths With the new large sector size support, it's now the case that set_blocksize can change i_blksize and the folio order in a manner that conflicts with a concurrent reader and causes a kernel crash. Specifically, let's say that udev-worker calls libblkid to detect the labels on a block device. The read call can create an order-0 folio to read the first 4096 bytes from the disk. But then udev is preempted. Next, someone tries to mount an 8k-sectorsize filesystem from the same block device. The filesystem calls set_blksize, which sets i_blksize to 8192 and the minimum folio order to 1. Now udev resumes, still holding the order-0 folio it allocated. It then tries to schedule a read bio and do_mpage_readahead tries to create bufferheads for the folio. Unfortunately, blocks_per_folio == 0 because the page size is 4096 but the blocksize is 8192 so no bufferheads are attached and the bh walk never sets bdev. We then submit the bio with a NULL block device and crash. Therefore, truncate the page cache after flushing but before updating i_blksize. However, that's not enough -- we also need to lock out file IO and page faults during the update. Take both the i_rwsem and the invalidate_lock in exclusive mode for invalidations, and in shared mode for read/write operations. I don't know if this is the correct fix, but xfs/259 found it.
CVSS

No CVSS.

Configurations

No configuration.

History

23 Oct 2025, 15:15

Type Values Removed Values Added
References
  • () https://git.kernel.org/stable/c/a0caf1de97e1edd7f3451f1818ea6cb970495fc5 -
Summary
  • (es) En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: bloque: corregir ejecución entre set_blocksize y las rutas de lectura Con el nuevo soporte para tamaños de sector grandes, ahora es posible que set_blocksize cambie i_blksize y el orden de los folios de forma que entre en conflicto con un lector concurrente y provoque un fallo del kernel. Específicamente, supongamos que udev-worker llama a libblkid para detectar las etiquetas en un dispositivo de bloque. La llamada de lectura puede crear un folio de orden 0 para leer los primeros 4096 bytes del disco. Pero entonces udev es interrumpido. A continuación, alguien intenta montar un sistema de archivos de tamaño de sector de 8k desde el mismo dispositivo de bloque. El sistema de archivos llama a set_blksize, que establece i_blksize en 8192 y el orden mínimo de folio en 1. Ahora udev se reanuda, aún manteniendo el folio de orden 0 que asignó. Entonces intenta programar una biografía de lectura y do_mpage_readahead intenta crear bufferheads para el folio. Desafortunadamente, bloques_por_folio == 0 porque el tamaño de página es 4096, pero el tamaño de bloque es 8192, por lo que no se conectan bufferheads y el bh walk nunca establece bdev. Luego, enviamos la biografía con un dispositivo de bloque nulo y se produce un fallo. Por lo tanto, truncamos la caché de páginas después del vaciado, pero antes de actualizar i_blksize. Sin embargo, esto no es suficiente; también necesitamos bloquear la E/S de archivos y los fallos de página durante la actualización. Use tanto i_rwsem como invalidate_lock en modo exclusivo para invalidaciones y en modo compartido para operaciones de lectura/escritura. No sé si esta sea la solución correcta, pero xfs/259 la encontró.

18 Jun 2025, 10:15

Type Values Removed Values Added
New CVE

Information

Published : 2025-06-18 10:15

Updated : 2025-10-23 15:15


NVD link : CVE-2025-38073

Mitre link : CVE-2025-38073

CVE.ORG link : CVE-2025-38073


JSON object : View

Products Affected

No product.

CWE

No CWE.