CVE-2025-38691
JSON

5.5medium

pNFS: Fix uninited ptr deref in block/scsi layout

Severity
5.5medium CVSS:3.1 by NVD
Exploit likelihood
0.20% (higher than 10% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: pNFS: Fix uninited ptr deref in block/scsi layout The error occurs on the third attempt to encode extents. When function ext_tree_prepare_commit() reallocates a larger buffer to retry encoding extents, the "layoutupdate_pages" page array is initialized only after the retry loop. But ext_tree_free_commitdata() is called on every iteration and tries to put pages in the array, thus dereferencing uninitialized pointers. An additional problem is that there is no limit on the maximum possible buffer_size. When there are too many extents, the client may create a layoutcommit that is larger than the maximum possible RPC size accepted by the server. During testing, we observed two typical scenarios. First, one memory page for extents is enough when we work with small files, append data to the end of the file, or preallocate extents before writing. But when we fill a new large file without preallocating, the number of extents can be huge, and counting the number of written extents in ext_tree_encode_commit() does not help much. Since this number increases even more between unlocking and locking of ext_tree, the reallocated buffer may not be large enough again and again.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 34dc93c2fc04da0d01acf8a1660b4ab276208af7 before 579b85f893d9885162e1cabf99a4a088916e143e, from 34dc93c2fc04da0d01acf8a1660b4ab276208af7 before 2896f101110076ac6bf99d7aaf463d61e26f89dd, from 34dc93c2fc04da0d01acf8a1660b4ab276208af7 before 4f783333cbfa2ee7d4aa8e47f6bd1b3f77534fcf, from 34dc93c2fc04da0d01acf8a1660b4ab276208af7 before 9be5c04beca3202d0a5f09fb4b2ecb644caa0bc5, from 34dc93c2fc04da0d01acf8a1660b4ab276208af7 before 24334f3cf8a294f253071b5bf22d754dbb6d0f2d, from 34dc93c2fc04da0d01acf8a1660b4ab276208af7 before f0b2eee3fbba9b7e3746ef698424ef5e4a197776, from 34dc93c2fc04da0d01acf8a1660b4ab276208af7 before 94ec6d939031a616474376dadbf4a8d0ef8b0bcc, from 34dc93c2fc04da0d01acf8a1660b4ab276208af7 before 37c3443a2685528f972d910a6fb87716b96fef46 and 2 more
Not affected: before 3.18, from 5.4.297 up to 5.4.*, from 5.10.241 up to 5.10.*, from 5.15.190 up to 5.15.*, from 6.1.149 up to 6.1.*, from 6.6.103 up to 6.6.*
CVE List
linux linux_kernelfrom 3.18 before 5.4.297, from 5.5 before 5.10.241, from 5.11 before 5.15.190, from 5.16 before 6.1.149, from 6.2 before 6.6.103, from 6.7 before 6.12.43, from 6.13 before 6.15.11, from 6.16 before 6.16.2NVD
debian debian_linux11.0NVD

Classification

CWE-908

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: pNFS: Fix uninited ptr deref in block/scsi layout The error occurs on the third attempt to encode extents. When function ext_tree_prepare_commit() reallocates a larger buffer to retry encoding extents, the "layoutupdate_pages" page array is initialized only after the retry loop. But ext_tree_free_commitdata() is called on every iteration and tries to put pages in the array, thus dereferencing uninitialized pointers. An additional problem is that there is no limit on the maximum possible buffer_size. When there are too many extents, the client may create a layoutcommit that is larger than the maximum possible RPC size accepted by the server. During testing, we observed two typical scenarios. First, one memory page for extents is enough when we work with small files, append data to the end of the file, or preallocate extents before writing. But when we fill a new large file without preallocating, the number of extents can be huge, and counting the number of written extents in ext_tree_encode_commit() does not help much. Since this number increases even more between unlocking and locking of ext_tree, the reallocated buffer may not be large enough again and again.

NVD (es)

En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: pNFS: Corrección de desreferencia de puntero no inicializado en el diseño de bloque/scsi El error ocurre en el tercer intento de codificar extensiones. Cuando la función ext_tree_prepare_commit() reasigna un búfer más grande para reintentar la codificación de extensiones, el array de páginas 'layoutupdate_pages' se inicializa solo después del bucle de reintento. Pero ext_tree_free_commitdata() es llamada en cada iteración e intenta colocar páginas en el array, desreferenciando así punteros no inicializados. Un problema adicional es que no hay límite en el tamaño máximo posible de búfer. Cuando hay demasiadas extensiones, el cliente puede crear un layoutcommit que es más grande que el tamaño máximo posible de RPC aceptado por el servidor. Durante las pruebas, observamos dos escenarios típicos. Primero, una página de memoria para extensiones es suficiente cuando trabajamos con archivos pequeños, adjuntamos datos al final del archivo o preasignamos extensiones antes de escribir. Pero cuando llenamos un nuevo archivo grande sin preasignar, el número de extensiones puede ser enorme, y contar el número de extensiones escritas en ext_tree_encode_commit() no ayuda mucho. Dado que este número aumenta aún más entre el desbloqueo y el bloqueo de ext_tree, el búfer reasignado puede no ser lo suficientemente grande una y otra vez.

References

https://git.kernel.org/stable/c/579b85f893d9885162e1cabf99a4a088916e143epatch
https://git.kernel.org/stable/c/2896f101110076ac6bf99d7aaf463d61e26f89ddpatch
https://git.kernel.org/stable/c/4f783333cbfa2ee7d4aa8e47f6bd1b3f77534fcfpatch
https://git.kernel.org/stable/c/9be5c04beca3202d0a5f09fb4b2ecb644caa0bc5patch
https://git.kernel.org/stable/c/24334f3cf8a294f253071b5bf22d754dbb6d0f2dpatch
https://git.kernel.org/stable/c/f0b2eee3fbba9b7e3746ef698424ef5e4a197776patch
https://git.kernel.org/stable/c/94ec6d939031a616474376dadbf4a8d0ef8b0bccpatch
https://git.kernel.org/stable/c/37c3443a2685528f972d910a6fb87716b96fef46patch
https://git.kernel.org/stable/c/9768797c219326699778fba9cd3b607b2f1e7950patch
https://lists.debian.org/debian-lts-announce/2025/10/msg00008.htmlthird-party-advisory
https://lists.debian.org/debian-lts-announce/2025/10/msg00007.htmlthird-party-advisory
https://cert-portal.siemens.com/productcert/html/ssa-082556.html

Sources

SourceRecordLicence
CVE ListCVE-2025-38691 changed 2026-11-05CVE Terms of Use
NVDCVE-2025-38691 changed 2026-11-05Public domain