# CVE-2025-40241: erofs: fix crafted invalid cases for encoded extents

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.22%, higher than 7% of CVEs (2026-11-30)
- Published: 2025-12-04T15:31:30.594Z
- Modified: 2026-10-19T19:10:00.130Z
- Assigned by: Linux

## 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.

(As written by CVE List.)

## Affected

- Linux Linux: from 1d191b4ca51d73699cb127386b95ac152af2b930 before 00d8fe0b72f4ca0a983abced36aad2160038c421; from 1d191b4ca51d73699cb127386b95ac152af2b930 before a429b76114aaca3ef1aff4cd469dcf025431bd11; 6.15 (not affected: before 6.15; from 6.17.6 up to 6.17.*; from 6.18 up to *)

## References

- <https://git.kernel.org/stable/c/00d8fe0b72f4ca0a983abced36aad2160038c421>
- <https://git.kernel.org/stable/c/a429b76114aaca3ef1aff4cd469dcf025431bd11>

## Sources

- CVE List: [CVE-2025-40241](https://www.cve.org/CVERecord?id=CVE-2025-40241), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2025-40241](https://nvd.nist.gov/vuln/detail/CVE-2025-40241), Public domain, modified 2026-10-19

---

Page: https://cve.day/CVE-2025-40241 · Whole record: https://cve.day/CVE-2025-40241.json · Rebuilt by cve.day 2026-11-25T22:59:08.270Z
