← Back to CVE Explorer

CVE-2025-38691

Full vulnerability record from the local CVENow database.

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.

Severity
MEDIUM
CVSS score
5.5 (v3.1)
Vulnerability status
Modified
Source identifier
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Published
2025-09-04 16:15:37.297000
Last modified
2026-10-19 21:10:00.160000
View original CVE JSON
{
  "id": "CVE-2025-38691",
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "published": "2025-09-04T16:15:37.297",
  "lastModified": "2026-10-19T21:10:00.160",
  "vulnStatus": "Modified",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\npNFS: Fix uninited ptr deref in block/scsi layout\n\nThe error occurs on the third attempt to encode extents. When function\next_tree_prepare_commit() reallocates a larger buffer to retry encoding\nextents, the \"layoutupdate_pages\" page array is initialized only after the\nretry loop. But ext_tree_free_commitdata() is called on every iteration\nand tries to put pages in the array, thus dereferencing uninitialized\npointers.\n\nAn additional problem is that there is no limit on the maximum possible\nbuffer_size. When there are too many extents, the client may create a\nlayoutcommit that is larger than the maximum possible RPC size accepted\nby the server.\n\nDuring testing, we observed two typical scenarios. First, one memory page\nfor extents is enough when we work with small files, append data to the\nend of the file, or preallocate extents before writing. But when we fill\na new large file without preallocating, the number of extents can be huge,\nand counting the number of written extents in ext_tree_encode_commit()\ndoes not help much. Since this number increases even more between\nunlocking and locking of ext_tree, the reallocated buffer may not be\nlarge enough again and again."
    },
    {
      "lang": "es",
      "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\npNFS: Corrección de desreferencia de puntero no inicializado en el diseño de bloque/scsi\n\nEl 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.\n\nUn 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.\n\nDurante 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."
    }
  ],
  "affected": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "affectedData": [
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "unaffected",
          "programFiles": [
            "fs/nfs/blocklayout/extent_tree.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "579b85f893d9885162e1cabf99a4a088916e143e",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "2896f101110076ac6bf99d7aaf463d61e26f89dd",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "4f783333cbfa2ee7d4aa8e47f6bd1b3f77534fcf",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "9be5c04beca3202d0a5f09fb4b2ecb644caa0bc5",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "24334f3cf8a294f253071b5bf22d754dbb6d0f2d",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "f0b2eee3fbba9b7e3746ef698424ef5e4a197776",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "94ec6d939031a616474376dadbf4a8d0ef8b0bcc",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "37c3443a2685528f972d910a6fb87716b96fef46",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "34dc93c2fc04da0d01acf8a1660b4ab276208af7",
              "lessThan": "9768797c219326699778fba9cd3b607b2f1e7950",
              "versionType": "git",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "affected",
          "programFiles": [
            "fs/nfs/blocklayout/extent_tree.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "3.18",
              "status": "affected"
            },
            {
              "version": "0",
              "lessThan": "3.18",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "5.4.297",
              "lessThanOrEqual": "5.4.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "5.10.241",
              "lessThanOrEqual": "5.10.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "5.15.190",
              "lessThanOrEqual": "5.15.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.1.149",
              "lessThanOrEqual": "6.1.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.6.103",
              "lessThanOrEqual": "6.6.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.12.43",
              "lessThanOrEqual": "6.12.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.15.11",
              "lessThanOrEqual": "6.15.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.16.2",
              "lessThanOrEqual": "6.16.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.17",
              "lessThanOrEqual": "*",
              "versionType": "original_commit_for_fix",
              "status": "unaffected"
            }
          ]
        }
      ]
    },
    {
      "source": "0b142b55-0307-4c5a-b3c9-f314f3fb7c5e",
      "affectedData": [
        {
          "vendor": "Siemens",
          "product": "SIMATIC CN 4100",
          "defaultStatus": "unknown",
          "versions": [
            {
              "version": "0",
              "lessThan": "V5.0",
              "versionType": "custom",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Siemens",
          "product": "SIMATIC S7-1500 CPU 1518-4 PN/DP MFP",
          "defaultStatus": "unknown",
          "versions": [
            {
              "version": "V3.1.5",
              "lessThan": "*",
              "versionType": "custom",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Siemens",
          "product": "SIMATIC S7-1500 CPU 1518-4 PN/DP MFP",
          "defaultStatus": "unknown",
          "versions": [
            {
              "version": "V3.1.5",
              "lessThan": "*",
              "versionType": "custom",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Siemens",
          "product": "SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP",
          "defaultStatus": "unknown",
          "versions": [
            {
              "version": "V3.1.5",
              "lessThan": "*",
              "versionType": "custom",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Siemens",
          "product": "SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP",
          "defaultStatus": "unknown",
          "versions": [
            {
              "version": "V3.1.5",
              "lessThan": "*",
              "versionType": "custom",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Siemens",
          "product": "SIPLUS S7-1500 CPU 1518-4 PN/DP MFP",
          "defaultStatus": "unknown",
          "versions": [
            {
              "version": "V3.1.5",
              "lessThan": "*",
              "versionType": "custom",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Primary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
          "baseScore": 5.5,
          "baseSeverity": "MEDIUM",
          "attackVector": "LOCAL",
          "attackComplexity": "LOW",
          "privilegesRequired": "LOW",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "NONE",
          "integrityImpact": "NONE",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 1.8,
        "impactScore": 3.6
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Primary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-908"
        }
      ]
    }
  ],
  "configurations": [
    {
      "nodes": [
        {
          "operator": "OR",
          "negate": false,
          "cpeMatch": [
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "versionStartIncluding": "3.18",
              "versionEndExcluding": "5.4.297",
              "matchCriteriaId": "7C3CC0C7-EC92-4C96-89F4-1F7168E8C1D4"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "versionStartIncluding": "5.5",
              "versionEndExcluding": "5.10.241",
              "matchCriteriaId": "D0D21C35-EB8A-488A-BBF9-403E4817E5DD"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "versionStartIncluding": "5.11",
              "versionEndExcluding": "5.15.190",
              "matchCriteriaId": "AD9E597F-3DDE-4D7E-976C-463D0611F13F"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "versionStartIncluding": "5.16",
              "versionEndExcluding": "6.1.149",
              "matchCriteriaId": "FDBE8280-8983-4D2D-943D-2E6D0104E2D8"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "versionStartIncluding": "6.2",
              "versionEndExcluding": "6.6.103",
              "matchCriteriaId": "F2293654-7169-49B5-8D0D-EE51EF8B8E48"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "versionStartIncluding": "6.7",
              "versionEndExcluding": "6.12.43",
              "matchCriteriaId": "472C5F87-2BF3-4FAB-9B21-DA7513977363"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "versionStartIncluding": "6.13",
              "versionEndExcluding": "6.15.11",
              "matchCriteriaId": "BC242347-F722-43AE-B910-BE0B22386977"
            },
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
              "versionStartIncluding": "6.16",
              "versionEndExcluding": "6.16.2",
              "matchCriteriaId": "BD7C087D-2415-4521-B624-30003352F899"
            }
          ]
        }
      ]
    },
    {
      "nodes": [
        {
          "operator": "OR",
          "negate": false,
          "cpeMatch": [
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*",
              "matchCriteriaId": "FA6FEEC2-9F11-4643-8827-749718254FED"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://git.kernel.org/stable/c/24334f3cf8a294f253071b5bf22d754dbb6d0f2d",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://git.kernel.org/stable/c/2896f101110076ac6bf99d7aaf463d61e26f89dd",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://git.kernel.org/stable/c/37c3443a2685528f972d910a6fb87716b96fef46",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://git.kernel.org/stable/c/4f783333cbfa2ee7d4aa8e47f6bd1b3f77534fcf",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://git.kernel.org/stable/c/579b85f893d9885162e1cabf99a4a088916e143e",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://git.kernel.org/stable/c/94ec6d939031a616474376dadbf4a8d0ef8b0bcc",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://git.kernel.org/stable/c/9768797c219326699778fba9cd3b607b2f1e7950",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://git.kernel.org/stable/c/9be5c04beca3202d0a5f09fb4b2ecb644caa0bc5",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://git.kernel.org/stable/c/f0b2eee3fbba9b7e3746ef698424ef5e4a197776",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "tags": [
        "Patch"
      ]
    },
    {
      "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html",
      "source": "af854a3a-2127-422b-91ae-364da2661108",
      "tags": [
        "Third Party Advisory"
      ]
    },
    {
      "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html",
      "source": "af854a3a-2127-422b-91ae-364da2661108",
      "tags": [
        "Third Party Advisory"
      ]
    },
    {
      "url": "https://cert-portal.siemens.com/productcert/html/ssa-032379.html",
      "source": "0b142b55-0307-4c5a-b3c9-f314f3fb7c5e"
    },
    {
      "url": "https://cert-portal.siemens.com/productcert/html/ssa-082556.html",
      "source": "0b142b55-0307-4c5a-b3c9-f314f3fb7c5e"
    }
  ]
}