CVE-2025-40241: erofs: fix crafted invalid cases for encoded extents
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 & ZEROFSEXTENTPLENMASK) == 0. It is used to represent special extents such as sparse extents (!EROFSMAPMAPPED), but previously only plen == 0 was handled;
- The second one [2] has pa 0xffffffffffdcffed and plen 0xb4000, then "cur [0xfffffffffffff000] += bvec.bvlen [0x1000]" in "} while ((cur += bvec.bvlen) < end);" wraps around, causing an out-of-bound access of pcl->compressedbvecs[] in zerofssubmitqueue(). EROFS only supports 48-bit physical block addresses (up to 1EiB for 4k blocks), so add a sanity check to enforce this.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernel erofs (encoded extents)to a version that resolves this vulnerability.Fixed in 6.15Patch erofs: fix crafted invalid cases for encoded extents - Configuration
In z_erofs_submit_queue() (erofs), add/enforce a sanity check for crafted invalid cases for encoded extents so that invalid plen handling (including out-of-bound access to pcl->compressed_bvecs[] and wraparound) is prevented; ensure the additional crafted cases beyond only plen == 0 are handled.
Linux kernel erofs encoded extents sanity check / invalid cases handling = enabled
Event History
Frequently Asked Questions
What is the severity of CVE-2025-40241?
CVE-2025-40241 has been classified with a severity rating that indicates a potential for system instability due to crafted invalid cases.
How do I fix CVE-2025-40241?
To fix CVE-2025-40241, it is advised to update the Linux kernel to a version later than 6.15 where this vulnerability has been resolved.
What versions of the Linux kernel are affected by CVE-2025-40241?
CVE-2025-40241 specifically affects the Linux kernel version 6.15.
What type of vulnerability is CVE-2025-40241?
CVE-2025-40241 is a vulnerability related to system crashes caused by corrupted images affecting the encoded extents in the Linux kernel.
Who reported CVE-2025-40241?
CVE-2025-40241 was reported by an individual named Robert, who identified issues with corrupted image handling.