CVE-2025-38691: pNFS: Fix uninited ptr deref in block/scsi layout
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 exttreepreparecommit() reallocates a larger buffer to retry encoding extents, the "layoutupdatepages" page array is initialized only after the retry loop. But exttreefreecommitdata() 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 buffersize. 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 exttreeencodecommit() does not help much. Since this number increases even more between unlocking and locking of exttree, the reallocated buffer may not be large enough again and again.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-38691?
CVE-2025-38691 has been classified as a medium severity vulnerability due to potential memory corruption issues.
How do I fix CVE-2025-38691?
To mitigate CVE-2025-38691, upgrading to the latest version of the Linux kernel that addresses this vulnerability is recommended.
What type of systems are affected by CVE-2025-38691?
CVE-2025-38691 affects various systems running vulnerable versions of the Linux kernel, particularly those utilizing the pNFS feature.
What are the risks associated with CVE-2025-38691?
The risks associated with CVE-2025-38691 include potential system crashes or instability caused by uninitialized pointer dereferences.
When was CVE-2025-38691 disclosed?
CVE-2025-38691 was disclosed as a resolved vulnerability in the Linux kernel, with associated fixes made public in the respective kernel updates.