CVE-2022-49409: ext4: fix bug_on in __es_tree_search
In the Linux kernel, the following vulnerability has been resolved:
ext4: fix bugon in estreesearch
Hulk Robot reported a BUGON: ================================================================== 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 ext4iget ext4iget ext4extcheckinode ext4extcheck ext4extcheck ext4validextententries 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 extentheader 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 extentidx.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.3 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.5 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.11 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 3.13 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.4.277 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.121 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.46 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.17.14 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.18.3 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.18.5-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.4-1Fixed in 7.3.5-1 - Upgrade
Upgrade
ubuntu/linux-aws-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1130.140~18.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1135.142~18.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1134.143~18.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-192.212~18.04.1 - Upgrade
Upgrade
ubuntu/linux-ibm-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1077.82~18.04.1 - Upgrade
Upgrade
ubuntu/linux-oracle-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1129.138~18.04.1 - Upgrade
Upgrade
ubuntu/linux-raspi-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1114.126~18.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.4.0-192.212 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.4.0-1130.140 - Upgrade
Upgrade
ubuntu/linux-aws-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1019.23~20.04.1 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.4.0-1135.142 - Upgrade
Upgrade
ubuntu/linux-azure-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1019.24~20.04.1 - Upgrade
Upgrade
ubuntu/linux-bluefieldto a version that resolves this vulnerability.Fixed in 5.4.0-1090.97 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.4.0-1134.143 - Upgrade
Upgrade
ubuntu/linux-gcp-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1017.23~20.04.2 - Upgrade
Upgrade
ubuntu/linux-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-48.54~20.04.1 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.4.0-1077.82 - Upgrade
Upgrade
ubuntu/linux-intel-iotg-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1015.20~20.04.2 - Upgrade
Upgrade
ubuntu/linux-iotto a version that resolves this vulnerability.Fixed in 5.4.0-1042.43 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.4.0-1118.125 - Upgrade
Upgrade
ubuntu/linux-lowlatency-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-48.54~20.04.1 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.4.0-1129.138 - Upgrade
Upgrade
ubuntu/linux-oracle-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1017.22~20.04.1 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.4.0-1114.126 - Upgrade
Upgrade
ubuntu/linux-riscv-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1018.21~20.04.1 - Upgrade
Upgrade
ubuntu/linux-xilinx-zynqmpto a version that resolves this vulnerability.Fixed in 5.4.0-1049.53 - Upgrade
Upgrade
ubuntu/linux-aws-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1130.140+fips1 - Upgrade
Upgrade
ubuntu/linux-azure-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1135.142+fips1 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1104.114 - Upgrade
Upgrade
ubuntu/linux-gcp-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1134.143+fips1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.15.0-47.51 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.15.0-1019.23 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.15.0-1019.24 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.15.0-1017.23 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 5.15.0-1015.18 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.15.0-1002.4 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.15.0-1013.15 - Upgrade
Upgrade
ubuntu/linux-intel-iotgto a version that resolves this vulnerability.Fixed in 5.15.0-1015.20 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.15.0-1017.21 - Upgrade
Upgrade
ubuntu/linux-lowlatencyto a version that resolves this vulnerability.Fixed in 5.15.0-47.53 - Upgrade
Upgrade
ubuntu/linux-nvidiato a version that resolves this vulnerability.Fixed in 5.15.0-1007.7 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.15.0-1017.22 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.15.0-1014.16 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1020.20
Event History
Frequently Asked Questions
What level of access does an attacker need?
The supplied CVSS vector indicates local access and low privileges are required. No user interaction is required.
What is the primary security impact?
The impact is availability loss: the vulnerability can trigger a kernel BUG in the ext4 extent-status tree search path. The CVSS vector indicates no confidentiality or integrity impact.
How can I recognize a related failure on a system?
The reported failure includes a kernel BUG at fs/ext4/extents_status.c:199, with ext4_es_end and __es_tree_search in the call trace. The trace shown proceeds through ext4 quota handling while quotas are being enabled during filesystem mount.
Which systems should be reviewed for remediation?
Review systems using the Linux kernel packages listed in the advisory, including Ubuntu linux, linux-fips, linux-aws, linux-azure, linux-gcp, and linux-kvm packages, as well as Debian linux. The references identify stable-kernel fixes, but no affected or fixed package versions are provided.