CVE-2025-40200
Description
In the Linux kernel, the following vulnerability has been resolved:
Squashfs: reject negative file sizes in squashfs_read_inode()
Syskaller reports a "WARNING in ovl_copy_up_file" in overlayfs.
This warning is ultimately caused because the underlying Squashfs file system returns a file with a negative file size.
This commit checks for a negative file size and returns EINVAL.
[phillip@squashfs.org.uk: only need to check 64 bit quantity]
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Squashfs now rejects negative file sizes in read_inode() to prevent a kernel warning in overlayfs and potential denial of service.
Root
Cause
In the Linux kernel's Squashfs filesystem, the squashfs_read_inode() function did not validate that the file size (stored as a 64-bit signed integer) was negative. When a crafted Squashfs image containing a negative file size was mounted, the function would propagate this invalid value to other kernel subsystems, such as overlayfs, triggering a warning in ovl_copy_up_file() [1].
Attack
Vector
An attacker with the ability to mount a malicious Squashfs image (e.g., via a removable device, network share, or in a container environment) could exploit this missing validation. The attack requires local access or the ability to trigger a mount operation using a crafted filesystem image. No additional authentication is needed beyond standard mount permissions.
Impact
Upon accessing the file with a negative size, the kernel emits a warning message and may exhibit unpredictable behavior, effectively leading to a denial of service (system instability or panic). The patch by Phillip Lougher adds a check for a negative 64-bit file size in squashfs_read_inode() and returns -EINVAL immediately, preventing the invalid value from reaching higher layers [1].
Mitigation
The fix has been merged into the stable kernel tree. Users should update their kernel to a version containing commit 875fb3f87ae0 or the corresponding backports (commits f271155ff31a, 8118f6612489, 8c7aad767518) [2][3][4]. No workaround other than avoiding the use of untrusted Squashfs images is available.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
3Patches
854170057a5fa2871c74caa3ffbfc745db6288118f66124898c7aad767518875fb3f87ae0f271155ff31a9f1c14c1de1bVulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
8- git.kernel.org/stable/c/2871c74caa3f4f05b429e6bfefebac62dbf1b408nvd
- git.kernel.org/stable/c/54170057a5fadd24a37b70de41e61d39284d9bd7nvd
- git.kernel.org/stable/c/8118f66124895829443d09c207e654adcb2f9321nvd
- git.kernel.org/stable/c/875fb3f87ae0225b881319ba016a1a8c4ffd5812nvd
- git.kernel.org/stable/c/8c7aad76751816207fee556d44aa88a710824810nvd
- git.kernel.org/stable/c/9f1c14c1de1bdde395f6cc893efa4f80a2ae3b2bnvd
- git.kernel.org/stable/c/f271155ff31aca8ef82c61c8df23ca97e9a77dd4nvd
- git.kernel.org/stable/c/fbfc745db628de31f5c089147deeb87e95b89e66nvd
News mentions
0No linked articles in our index yet.