Vulnerability · Published Dec 9, 2025 · Assigned by Linux
CVE-2022-50638ext4: fix bug_on in __es_tree_search caused by bad boot loader inode
Unrated
In plain English
A security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 16% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: ext4: fix bug_on in __es_tree_search caused by bad boot loader inode We got a issue as fllows: ================================================================== kernel BUG at fs/ext4/extents_status.c:203! invalid opcode: 0000 [#1] PREEMPT SMP CPU: 1 PID: 945 Comm: cat Not tainted 6.0.0-next-20221007-dirty #349 RIP: 0010:ext4_es_end.isra.0+0x34/0x42 RSP: 0018:ffffc9000143b768 EFLAGS: 00010203 RAX: 0000000000000000 RBX: ffff8881769cd0b8 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8fc27cf7 RDI: 00000000ffffffff RBP: ffff8881769cd0bc R08: 0000000000000000 R09: ffffc9000143b5f8 R10: 0000000000000001 R11: 0000000000000001 R12: ffff8881769cd0a0 R13: ffff8881768e5668 R14: 00000000768e52f0 R15: 0000000000000000 FS: 00007f359f7f05c0(0000)GS:ffff88842fd00000(0000)knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f359f5a2000 CR3: 000000017130c000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> __es_tree_search.isra.0+0x6d/0xf5 ext4_es_cache_extent+0xfa/0x230 ext4_cache_extents+0xd2/0x110 ext4_find_extent+0x5d5/0x8c0 ext4_ext_map_blocks+0x9c/0x1d30 ext4_map_blocks+0x431/0xa50 ext4_mpage_readpages+0x48e/0xe40 ext4_readahead+0x47/0x50 read_pages+0x82/0x530 page_cache_ra_unbounded+0x199/0x2a0 do_page_cache_ra+0x47/0x70 page_cache_ra_order+0x242/0x400 ondemand_readahead+0x1e8/0x4b0 page_cache_sync_ra+0xf4/0x110 filemap_get_pages+0x131/0xb20 filemap_read+0xda/0x4b0 generic_file_read_iter+0x13a/0x250 ext4_file_read_iter+0x59/0x1d0 vfs_read+0x28f/0x460 ksys_read+0x73/0x160 __x64_sys_read+0x1e/0x30 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x63/0xcd </TASK> ================================================================== In the above issue, ioctl invokes the swap_inode_boot_loader function to swap inode<5> and inode<12>. However, inode<5> contain incorrect imode and disordered extents, and i_nlink is set to 1. The extents check for inode in the ext4_iget function can be bypassed bacause 5 is EXT4_BOOT_LOADER_INO. While links_count is set to 1, the extents are not initialized in swap_inode_boot_loader. After the ioctl command is executed successfully, the extents are swapped to inode<12>, in this case, run the `cat` command to view inode<12>. And Bug_ON is triggered due to the incorrect extents. When the boot loader inode is not initialized, its imode can be one of the following: 1) the imode is a bad type, which is marked as bad_inode in ext4_iget and set to S_IFREG. 2) the imode is good type but not S_IFREG. 3) the imode is S_IFREG. The BUG_ON may be triggered by bypassing the check in cases 1 and 2. Therefore, when the boot loader inode is bad_inode or its imode is not S_IFREG, initialize the inode to avoid triggering the BUG.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.4-1 | DEBIAN-CVE-2022-50638 |
| Debian:13 | linux | 6.1.4-1 | DEBIAN-CVE-2022-50638 |
| Debian:14 | linux | 6.1.4-1 | DEBIAN-CVE-2022-50638 |
| Rocky Linux:8 | kernel | 0:4.18.0-553.123.1.el8_10.cloud.0.1 | RXSA-2024:3138 |
| Ubuntu:22.04:LTS | linux | 5.15.0-69.76 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1033.37 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1035.42 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1035.42.1 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1031.38 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1030.35 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1017.22 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1027.30 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1027.32 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1030.35 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-69.76 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1023.23 | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1032.38 | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1026.28 | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:24.04:LTS | linux-riscv-6.14 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2022-50638 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2022-50638 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 393d1d1d76933886d5e1ce603214c9987589c6d5 – before e76ede9d2c9e0af4573342b56d7cdbf757c18084393d1d1d76933886d5e1ce603214c9987589c6d5 – before a95ba369255ddcdc5e43d38bc5203537bdf3a518393d1d1d76933886d5e1ce603214c9987589c6d5 – before 5f8d36abd2059bf1bd016b17d1fe78d8613deddd393d1d1d76933886d5e1ce603214c9987589c6d5 – before 78e335fb573e6a85718c4c24d5a052718a99a9ed393d1d1d76933886d5e1ce603214c9987589c6d5 – before 71e99ec1315fe98d322b17b9a28f204aaf15ffee393d1d1d76933886d5e1ce603214c9987589c6d5 – before d480a49c15c465cb9a16db1379f4996e9b5bb9cc393d1d1d76933886d5e1ce603214c9987589c6d5 – before feec0ea94c5ef4aa118750284c8a921698733ef2393d1d1d76933886d5e1ce603214c9987589c6d5 – before a125c8806b7d3c3815b6f9f59d395b9d7527b0ef |
| Linux | Linux | 3.10 |
References
- https://git.kernel.org/stable/c/e76ede9d2c9e0af4573342b56d7cdbf757c18084
- https://git.kernel.org/stable/c/a95ba369255ddcdc5e43d38bc5203537bdf3a518
- https://git.kernel.org/stable/c/5f8d36abd2059bf1bd016b17d1fe78d8613deddd
- https://git.kernel.org/stable/c/78e335fb573e6a85718c4c24d5a052718a99a9ed
- https://git.kernel.org/stable/c/71e99ec1315fe98d322b17b9a28f204aaf15ffee
- https://git.kernel.org/stable/c/d480a49c15c465cb9a16db1379f4996e9b5bb9cc
- https://git.kernel.org/stable/c/feec0ea94c5ef4aa118750284c8a921698733ef2
- https://git.kernel.org/stable/c/a125c8806b7d3c3815b6f9f59d395b9d7527b0ef
- https://git.kernel.org/stable/c/991ed014de0840c5dc405b679168924afb2952ac