CVE-2025-40241 (GCVE-0-2025-40241)

Vulnerability from cvelistv5 – Published: 2025-12-04 15:31 – Updated: 2026-08-05 12:08
VLAI
Title
erofs: fix crafted invalid cases for encoded extents
Summary
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.
Assigner
Linux CNA under the mitre root
CNA scorecard D 53/100 over 6659 records in the last 180 days details
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: 1d191b4ca51d73699cb127386b95ac152af2b930 , < 00d8fe0b72f4ca0a983abced36aad2160038c421 (git)
Affected: 1d191b4ca51d73699cb127386b95ac152af2b930 , < a429b76114aaca3ef1aff4cd469dcf025431bd11 (git)
guessed Create a notification for this product.
Linux Linux Affected: 6.15
Unaffected: 0 , < 6.15 (semver)
Unaffected: 6.17.6 , ≤ 6.17.* (semver)
Unaffected: 6.18 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/erofs/zmap.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "00d8fe0b72f4ca0a983abced36aad2160038c421",
              "status": "affected",
              "version": "1d191b4ca51d73699cb127386b95ac152af2b930",
              "versionType": "git"
            },
            {
              "lessThan": "a429b76114aaca3ef1aff4cd469dcf025431bd11",
              "status": "affected",
              "version": "1d191b4ca51d73699cb127386b95ac152af2b930",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/erofs/zmap.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.15"
            },
            {
              "lessThan": "6.15",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.17.*",
              "status": "unaffected",
              "version": "6.17.6",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.18",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.6",
                  "versionStartIncluding": "6.15",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18",
                  "versionStartIncluding": "6.15",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "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 \u0026 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) \u003c end);\" wraps around, causing an\n    out-of-bound access of pcl-\u003ecompressed_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."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The vulnerable data comes from an on-disk erofs extent record, and the bug is triggered by a local `read()`/`mmap()`/readahead on a file in a mounted erofs image via `z_erofs_aops.read_folio`. There is no network-facing service that reaches `z_erofs_map_blocks_ext()`.\nAC:L - Both `m_pa` and `m_plen` are read verbatim from the crafted image, so the attacker deterministically chooses the values that make `cur + pageofs_in + pclustersize` wrap; no race, timing window, or uncontrollable memory layout is involved. Robert Morris reproduced both cases with plain image files.\nPR:L - Once the image is mounted, any unprivileged user with read access to a file triggers the path \u2014 there is no capability check on `read_folio \u2192 z_erofs_scan_folios \u2192 z_erofs_pcluster_begin \u2192 z_erofs_submit_queue`. On Android and container hosts the attacker-supplied erofs image is mounted by the platform itself, so the attacker needs only ordinary local access.\nUI:N - In the deployments where erofs carries untrusted data (Android system/APEX/OTA images, container layers over fscache/composefs, file-backed mounts), the image is mounted automatically with no human action, and the attacker then triggers the bug with their own `read()`. No victim must open a file or insert media.\nS:U - The out-of-bounds accesses to `pcl-\u003ecompressed_bvecs[]` and the oversized bio_vec target the host kernel\u0027s own heap and page allocations. No hypervisor, IOMMU, or sandbox boundary is crossed.\nC:H - `z_erofs_fill_bio_vec()` reads a `struct z_erofs_bvec` from beyond the pcluster slab object and dereferences its `.page` as a real `struct page *` (`page_folio()`, `folio-\u003eprivate`, `folio-\u003emapping`), giving an attacker-steerable kernel read; the oversized bio_vec additionally makes the kernel treat memory past a single page as an I/O buffer whose contents the decompressor copies into page-cache folios readable from userspace.\nI:H - `pcl-\u003ecompressed_bvecs[nr].page = page` in `z_erofs_fill_bio_vec()` stores a kernel pointer past the end of the pcluster slab object at an attacker-influenced index, and the expanded `bvec.bv_len = end - cur` (up to ~1 MiB on one order-0 page) lets `vfs_iocb_iter_read()` in `erofs_fileio_rq_submit()` write attacker-controlled image bytes linearly over adjacent memory \u2014 a full heap overwrite primitive.\nA:H - The maintainer reports these crafted images \"cause system crashes\"; dereferencing and refcounting a garbage `struct page *` from the out-of-bounds bvec, plus slab corruption from the out-of-bounds store, reliably produce oopses, KASAN splats, and panics."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:08:45.194Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/00d8fe0b72f4ca0a983abced36aad2160038c421"
        },
        {
          "url": "https://git.kernel.org/stable/c/a429b76114aaca3ef1aff4cd469dcf025431bd11"
        }
      ],
      "title": "erofs: fix crafted invalid cases for encoded extents",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40241",
    "datePublished": "2025-12-04T15:31:30.594Z",
    "dateReserved": "2025-04-16T07:20:57.181Z",
    "dateUpdated": "2026-08-05T12:08:45.194Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-40241",
      "date": "2026-11-19",
      "epss": "0.00154",
      "percentile": "0.04655"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "fs/erofs/zmap.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "00d8fe0b72f4ca0a983abced36aad2160038c421",
                    "status": "affected",
                    "version": "1d191b4ca51d73699cb127386b95ac152af2b930",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "a429b76114aaca3ef1aff4cd469dcf025431bd11",
                    "status": "affected",
                    "version": "1d191b4ca51d73699cb127386b95ac152af2b930",
                    "versionType": "git"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "fs/erofs/zmap.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "6.15"
                  },
                  {
                    "lessThan": "6.15",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.17.*",
                    "status": "unaffected",
                    "version": "6.17.6",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "6.18",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "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 \u0026 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) \u003c end);\" wraps around, causing an\n    out-of-bound access of pcl-\u003ecompressed_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\u00f3n de casos inv\u00e1lidos manipulados para extensiones codificadas\n\nRobert inform\u00f3 recientemente de dos im\u00e1genes corruptas que pueden causar fallos del sistema, las cuales est\u00e1n 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 \u0026 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 \u201ccur [0xfffffffffffff000] += bvec.bv_len [0x1000]\u201d en \u201c} while ((cur += bvec.bv_len) \u003c end);\u201d se desborda, causando un acceso fuera de l\u00edmites de pcl -\u003e compressed_bvecs[] en z_erofs_submit_queue(). EROFS solo soporta direcciones de bloque f\u00edsico de 48 bits (hasta 1 EiB para bloques de 4k), por lo tanto, se a\u00f1ade una comprobaci\u00f3n de cordura para hacer cumplir esto."
          }
        ],
        "id": "CVE-2025-40241",
        "lastModified": "2026-10-19T19:10:00.130",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.9,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            }
          ]
        },
        "published": "2025-12-04T16:16:17.250",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/00d8fe0b72f4ca0a983abced36aad2160038c421"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/a429b76114aaca3ef1aff4cd469dcf025431bd11"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Deferred"
      }
    },
    "redhat_vex": {
      "aggregate_severity": "Low",
      "current_release_date": "2026-11-09T18:20:10+00:00",
      "cve": "CVE-2025-40241",
      "id": "CVE-2025-40241",
      "initial_release_date": "2025-12-04T00:00:00+00:00",
      "product_status:known_not_affected": "200",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: erofs: fix crafted invalid cases for encoded extents",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-40241.json",
      "version": "3"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.