← Back to CVE Explorer

CVE-2025-40241

Full vulnerability record from the local CVENow database.

Description

In the Linux kernel, the following vulnerability has been resolved: erofs: fix crafted invalid cases for encoded extents Robert recently reported two corrupted images that can cause system crashes, which are related to the new encoded extents introduced in Linux 6.15: - The first one [1] has plen != 0 (e.g. plen == 0x2000000) but (plen & Z_EROFS_EXTENT_PLEN_MASK) == 0. It is used to represent special extents such as sparse extents (!EROFS_MAP_MAPPED), but previously only plen == 0 was handled; - The second one [2] has pa 0xffffffffffdcffed and plen 0xb4000, then "cur [0xfffffffffffff000] += bvec.bv_len [0x1000]" in "} while ((cur += bvec.bv_len) < end);" wraps around, causing an out-of-bound access of pcl->compressed_bvecs[] in z_erofs_submit_queue(). EROFS only supports 48-bit physical block addresses (up to 1EiB for 4k blocks), so add a sanity check to enforce this.

Severity
HIGH
CVSS score
7.8 (v3.1)
Vulnerability status
Deferred
Source identifier
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Published
2025-12-04 16:16:17.250000
Last modified
2026-10-19 19:10:00.130000
View original CVE JSON
{
  "id": "CVE-2025-40241",
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "published": "2025-12-04T16:16:17.250",
  "lastModified": "2026-10-19T19:10:00.130",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nerofs: fix crafted invalid cases for encoded extents\n\nRobert recently reported two corrupted images that can cause system\ncrashes, which are related to the new encoded extents introduced\nin Linux 6.15:\n\n  - The first one [1] has plen != 0 (e.g. plen == 0x2000000) but\n    (plen & Z_EROFS_EXTENT_PLEN_MASK) == 0. It is used to represent\n    special extents such as sparse extents (!EROFS_MAP_MAPPED), but\n    previously only plen == 0 was handled;\n\n  - The second one [2] has pa 0xffffffffffdcffed and plen 0xb4000,\n    then \"cur [0xfffffffffffff000] += bvec.bv_len [0x1000]\" in\n    \"} while ((cur += bvec.bv_len) < end);\" wraps around, causing an\n    out-of-bound access of pcl->compressed_bvecs[] in\n    z_erofs_submit_queue().  EROFS only supports 48-bit physical block\n    addresses (up to 1EiB for 4k blocks), so add a sanity check to\n    enforce this."
    },
    {
      "lang": "es",
      "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nerofs: corrección de casos inválidos manipulados para extensiones codificadas\n\nRobert informó recientemente de dos imágenes corruptas que pueden causar fallos del sistema, las cuales están relacionadas con las nuevas extensiones codificadas introducidas en Linux 6.15:\n\n  - La primera [1] tiene plen != 0 (por ejemplo, plen == 0x2000000) pero (plen & Z_EROFS_EXTENT_PLEN_MASK) == 0. Se utiliza para representar extensiones especiales como extensiones dispersas (!EROFS_MAP_MAPPED), pero anteriormente solo se manejaba plen == 0;\n\n  - La segunda [2] tiene pa 0xffffffffffdcffed y plen 0xb4000, entonces “cur [0xfffffffffffff000] += bvec.bv_len [0x1000]” en “} while ((cur += bvec.bv_len) < end);” se desborda, causando un acceso fuera de límites de pcl -> compressed_bvecs[] en z_erofs_submit_queue(). EROFS solo soporta direcciones de bloque físico de 48 bits (hasta 1 EiB para bloques de 4k), por lo tanto, se añade una comprobación de cordura para hacer cumplir esto."
    }
  ],
  "affected": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "affectedData": [
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "unaffected",
          "programFiles": [
            "fs/erofs/zmap.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "1d191b4ca51d73699cb127386b95ac152af2b930",
              "lessThan": "00d8fe0b72f4ca0a983abced36aad2160038c421",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "1d191b4ca51d73699cb127386b95ac152af2b930",
              "lessThan": "a429b76114aaca3ef1aff4cd469dcf025431bd11",
              "versionType": "git",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "affected",
          "programFiles": [
            "fs/erofs/zmap.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "6.15",
              "status": "affected"
            },
            {
              "version": "0",
              "lessThan": "6.15",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.17.6",
              "lessThanOrEqual": "6.17.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.18",
              "lessThanOrEqual": "*",
              "versionType": "original_commit_for_fix",
              "status": "unaffected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
          "baseScore": 7.8,
          "baseSeverity": "HIGH",
          "attackVector": "LOCAL",
          "attackComplexity": "LOW",
          "privilegesRequired": "LOW",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 1.8,
        "impactScore": 5.9
      }
    ]
  },
  "references": [
    {
      "url": "https://git.kernel.org/stable/c/00d8fe0b72f4ca0a983abced36aad2160038c421",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/a429b76114aaca3ef1aff4cd469dcf025431bd11",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    }
  ]
}