# CVE-2022-50638: ext4: fix bug\_on in \_\_es\_tree\_search caused by bad boot loader inode

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.34% (percentile 20, 2026-11-28)
- **Published:** 2025-12-09T00:00:11.665Z
- **Modified:** 2026-11-10T12:10:00.177Z

## Who should check

- Anyone running Linux \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< e76ede9d2c9e0af4573342b56d7cdbf757c18084; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< a95ba369255ddcdc5e43d38bc5203537bdf3a518; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 5f8d36abd2059bf1bd016b17d1fe78d8613deddd; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 78e335fb573e6a85718c4c24d5a052718a99a9ed; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 71e99ec1315fe98d322b17b9a28f204aaf15ffee; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< d480a49c15c465cb9a16db1379f4996e9b5bb9cc; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< feec0ea94c5ef4aa118750284c8a921698733ef2; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< a125c8806b7d3c3815b6f9f59d395b9d7527b0ef; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 991ed014de0840c5dc405b679168924afb2952ac
- Anyone running Linux 3.10

## 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 and fixed versions

- Linux: \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< e76ede9d2c9e0af4573342b56d7cdbf757c18084; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< a95ba369255ddcdc5e43d38bc5203537bdf3a518; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 5f8d36abd2059bf1bd016b17d1fe78d8613deddd; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 78e335fb573e6a85718c4c24d5a052718a99a9ed; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 71e99ec1315fe98d322b17b9a28f204aaf15ffee; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< d480a49c15c465cb9a16db1379f4996e9b5bb9cc; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< feec0ea94c5ef4aa118750284c8a921698733ef2; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< a125c8806b7d3c3815b6f9f59d395b9d7527b0ef; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 991ed014de0840c5dc405b679168924afb2952ac (cvelist)
- Linux: 3.10 (cvelist)

## Mitigation

- Upgrade Linux to 991ed014de0840c5dc405b679168924afb2952ac or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-50638. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50638.md
Affected: Linux >= 393d1d1d76933886d5e1ce603214c9987589c6d5, < e76ede9d2c9e0af4573342b56d7cdbf757c18084; >= 393d1d1d76933886d5e1ce603214c9987589c6d5, < a95ba369255ddcdc5e43d38bc5203537bdf3a518; >= 393d1d1d76933886d5e1ce603214c9987589c6d5, < 5f8d36abd2059bf1bd016b17d1fe78d8613deddd; >= 393d1d1d76933886d5e1ce6…
Fixed in: Linux 5f8d36abd2059bf1bd016b17d1fe78d8613deddd, Linux 78e335fb573e6a85718c4c24d5a052718a99a9ed, Linux 71e99ec1315fe98d322b17b9a28f204aaf15ffee, Linux 991ed014de0840c5dc405b679168924afb2952ac

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-50638 being exploited?

There is no confirmed exploitation: CVE-2022-50638 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.34% chance of exploitation in the next 30 days (as of 2026-11-28).

### How serious is CVE-2022-50638?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2022-50638?

Linux \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< e76ede9d2c9e0af4573342b56d7cdbf757c18084; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< a95ba369255ddcdc5e43d38bc5203537bdf3a518; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 5f8d36abd2059bf1bd016b17d1fe78d8613deddd; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 78e335fb573e6a85718c4c24d5a052718a99a9ed; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 71e99ec1315fe98d322b17b9a28f204aaf15ffee; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< d480a49c15c465cb9a16db1379f4996e9b5bb9cc; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< feec0ea94c5ef4aa118750284c8a921698733ef2; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< a125c8806b7d3c3815b6f9f59d395b9d7527b0ef; \>= 393d1d1d76933886d5e1ce603214c9987589c6d5, \< 991ed014de0840c5dc405b679168924afb2952ac; Linux 3.10.

### Is there a fix for CVE-2022-50638?

Yes. Fixed in Linux 5f8d36abd2059bf1bd016b17d1fe78d8613deddd, Linux 78e335fb573e6a85718c4c24d5a052718a99a9ed, Linux 71e99ec1315fe98d322b17b9a28f204aaf15ffee, Linux 991ed014de0840c5dc405b679168924afb2952ac. Upgrade Linux to 991ed014de0840c5dc405b679168924afb2952ac or later.

### How do I check if I'm affected by CVE-2022-50638?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/e76ede9d2c9e0af4573342b56d7cdbf757c18084>
- other: <https://git.kernel.org/stable/c/a95ba369255ddcdc5e43d38bc5203537bdf3a518>
- other: <https://git.kernel.org/stable/c/5f8d36abd2059bf1bd016b17d1fe78d8613deddd>
- other: <https://git.kernel.org/stable/c/78e335fb573e6a85718c4c24d5a052718a99a9ed>
- other: <https://git.kernel.org/stable/c/71e99ec1315fe98d322b17b9a28f204aaf15ffee>
- other: <https://git.kernel.org/stable/c/d480a49c15c465cb9a16db1379f4996e9b5bb9cc>
- other: <https://git.kernel.org/stable/c/feec0ea94c5ef4aa118750284c8a921698733ef2>
- other: <https://git.kernel.org/stable/c/a125c8806b7d3c3815b6f9f59d395b9d7527b0ef>
- other: <https://git.kernel.org/stable/c/991ed014de0840c5dc405b679168924afb2952ac>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-50638>

HTML: <https://flawdb.com/CVE-2022-50638> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-50638>
