CVE-2022-49409

Source
https://cve.org/CVERecord?id=CVE-2022-49409
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49409.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49409
Downstream
Related
Published
2025-02-26T02:12:32.591Z
Modified
2026-03-12T03:25:08.079112Z
Summary
ext4: fix bug_on in __es_tree_search
Details

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

ext4: fix bug_on in __estreesearch

Hulk Robot reported a BUG_ON:

kernel BUG at fs/ext4/extentsstatus.c:199! [...] RIP: 0010:ext4esend fs/ext4/extentsstatus.c:199 [inline] RIP: 0010:_estreesearch+0x1e0/0x260 fs/ext4/extentsstatus.c:217 [...] Call Trace: ext4escacheextent+0x109/0x340 fs/ext4/extentsstatus.c:766 ext4cacheextents+0x239/0x2e0 fs/ext4/extents.c:561 ext4findextent+0x6b7/0xa20 fs/ext4/extents.c:964 ext4extmapblocks+0x16b/0x4b70 fs/ext4/extents.c:4384 ext4mapblocks+0xe26/0x19f0 fs/ext4/inode.c:567 ext4getblk+0x320/0x4c0 fs/ext4/inode.c:980 ext4bread+0x2d/0x170 fs/ext4/inode.c:1031 ext4quotaread+0x248/0x320 fs/ext4/super.c:6257 v2readheader+0x78/0x110 fs/quota/quotav2.c:63 v2checkquotafile+0x76/0x230 fs/quota/quotav2.c:82 vfsloadquotainode+0x5d1/0x1530 fs/quota/dquot.c:2368 dquotenable+0x28a/0x330 fs/quota/dquot.c:2490 ext4quotaenable fs/ext4/super.c:6137 [inline] ext4enablequotas+0x5d7/0x960 fs/ext4/super.c:6163 ext4fillsuper+0xa7c9/0xdc00 fs/ext4/super.c:4754 mountbdev+0x2e9/0x3b0 fs/super.c:1158 mountfs+0x4b/0x1e4 fs/super.c:1261

[...]

Above issue may happen as follows:

ext4fillsuper ext4enablequotas ext4quotaenable ext4_iget __ext4iget ext4extcheckinode ext4extcheck __ext4extcheck ext4_validextententries Check for overlapping extents does't take effect dquotenable vfsloadquotainode v2checkquotafile v2readheader ext4quotaread ext4bread ext4getblk ext4mapblocks ext4extmapblocks ext4findextent ext4cacheextents ext4escacheextent ext4escacheextent __estreesearch ext4esend BUGON(es->eslblk + es->eslen < es->eslblk)

The error ext4 extents is as follows: 0af3 0300 0400 0000 00000000 extent_header 00000000 0100 0000 12000000 extent1 00000000 0100 0000 18000000 extent2 02000000 0400 0000 14000000 extent3

In the ext4validextententries function, if prev is 0, no error is returned even if lblock<=prev. This was intended to skip the check on the first extent, but in the error image above, prev=0+1-1=0 when checking the second extent, so even though lblock<=prev, the function does not return an error. As a result, bugON occurs in __estreesearch and the system panics.

To solve this problem, we only need to check that: 1. The lblock of the first extent is not less than 0. 2. The lblock of the next extent is not less than the next block of the previous extent. The same applies to extent_idx.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49409.json",
    "cna_assigner": "Linux"
}
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
5946d089379a35dda0e531710b48fca05446a196
Fixed
d0083459e2b6b07ebd78bea2fe684a19cc0f3d0f
Fixed
4fd58b5cf118d2d9038a0b8c9cc0e43096297686
Fixed
3c617827cd51018bc377bd2954e176920ddbcfad
Fixed
59cf2fabbfe76de29d88dd7ae69858a25735b59f
Fixed
ea6ea18b3ab0c0d7fefffb3c4d27df758b1c790a
Fixed
d36f6ed761b53933b0b4126486c10d3da7751e7f
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
4645e4ee32aee01a85bdc03348982a65c65ce216
Last affected
a1192c0e5d037def6763f3873d3340615c241fe7
Last affected
ae21dda05193c441bde106a4bbf88c185a68fbed
Last affected
ea214c946ee77588c4313be3e9951edd25d6b270

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49409.json"