CVE-2025-40167

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-40167
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40167.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-40167
Downstream
Published
2025-11-12T10:26:24.498Z
Modified
2025-11-28T02:35:15.734411Z
Summary
ext4: detect invalid INLINE_DATA + EXTENTS flag combination
Details

In the Linux kernel, the following vulnerability has been resolved:

ext4: detect invalid INLINE_DATA + EXTENTS flag combination

syzbot reported a BUGON in ext4escacheextent() when opening a verity file on a corrupted ext4 filesystem mounted without a journal.

The issue is that the filesystem has an inode with both the INLINE_DATA and EXTENTS flags set:

EXT4-fs error (device loop0): ext4_cache_extents:545: inode #15:
comm syz.0.17: corrupted extent tree: lblk 0 < prev 66

Investigation revealed that the inode has both flags set: DEBUG: inode 15 - flag=1, iinlineoff=164, hasinline=1, extentsflag=1

This is an invalid combination since an inode should have either: - INLINE_DATA: data stored directly in the inode - EXTENTS: data stored in extent-mapped blocks

Having both flags causes ext4hasinlinedata() to return true, skipping extent tree validation in _ext4iget(). The unvalidated out-of-order extents then trigger a BUGON in ext4escache_extent() due to integer underflow when calculating hole sizes.

Fix this by detecting this invalid flag combination early in ext4_iget() and rejecting the corrupted inode.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40167.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
4954d297c91d292630ab43ba4d195dc371ce65d3
Fixed
f061f7c331fc16250fc82aa68964f35821687217
Fixed
2e9e10657b04152ed0d6ecae8d0c02a3405e28f5
Fixed
1437c95ab2a28b138d4521653583729f61ccb48b
Fixed
cb6039b68efa547b676a8a10fc4618d9d1865c23
Fixed
de985264eef64be8a90595908f2e6a87946dad34
Fixed
1f5ccd22ff482639133f2a0fe08f6d19d0e68717
Fixed
1d3ad183943b38eec2acf72a0ae98e635dc8456b

Database specific

source

"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40167.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.4.301
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.246
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.196
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.158
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.114
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.55
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.17.5

Database specific

source

"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-40167.json"