# CVE-2025-38222: ext4: inline: fix len overflow in ext4\_prepare\_inline\_data

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-190
- **Published:** 2025-07-04T13:37:37.879Z
- **Modified:** 2026-11-05T21:18:22.267Z

## Who should check

- Anyone running Linux \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< d3dfc60efd145df5324b99a244b0b05505cde29b; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 717414a8c083c376d4a8940a1230fe0c6ed4ee00; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 9d1d1c5bf4fc1af76be154d3afb2acdbd89ec7d8; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< cf5f319a2d8ab8238f8cf3a19463b9bff6420934; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 26e09d18599da0adc543eabd300080daaeda6869; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 5766da2237e539f259aa0e5f3639ae37b44ca458; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< e80ee0263d88d77f2fd1927f915003a7066cbb50; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 227cb4ca5a6502164f850d22aec3104d7888b270
- Anyone running Linux 3.8

## Description

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

ext4: inline: fix len overflow in ext4\_prepare\_inline\_data

When running the following code on an ext4 filesystem with inline\_data
feature enabled, it will lead to the bug below.

        fd = open("file1", O\_RDWR \| O\_CREAT \| O\_TRUNC, 0666);
        ftruncate(fd, 30);
        pwrite(fd, "a", 1, (1UL \<\< 40) + 5UL);

That happens because write\_begin will succeed as when
ext4\_generic\_write\_inline\_data calls ext4\_prepare\_inline\_data, pos + len
will be truncated, leading to ext4\_prepare\_inline\_data parameter to be 6
instead of 0x10000000006.

Then, later when write\_end is called, we hit:

        BUG\_ON(pos + len \> EXT4\_I(inode)-\>i\_inline\_size);

at ext4\_write\_inline\_data.

Fix it by using a loff\_t type for the len parameter in
ext4\_prepare\_inline\_data instead of an unsigned int.

\[   44.545164\] ------------\[ cut here \]------------
\[   44.545530\] kernel BUG at fs/ext4/inline.c:240!
\[   44.545834\] Oops: invalid opcode: 0000 \[\#1\] SMP NOPTI
\[   44.546172\] CPU: 3 UID: 0 PID: 343 Comm: test Not tainted 6.15.0-rc2-00003-g9080916f4863 \#45 PREEMPT(full)  112853fcebfdb93254270a7959841d2c6aa2c8bb
\[   44.546523\] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
\[   44.546523\] RIP: 0010:ext4\_write\_inline\_data+0xfe/0x100
\[   44.546523\] Code: 3c 0e 48 83 c7 48 48 89 de 5b 41 5c 41 5d 41 5e 41 5f 5d e9 e4 fa 43 01 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc 0f 0b \<0f\> 0b 0f 1f 44 00 00 55 41 57 41 56 41 55 41 54 53 48 83 ec 20 49
\[   44.546523\] RSP: 0018:ffffb342008b79a8 EFLAGS: 00010216
\[   44.546523\] RAX: 0000000000000001 RBX: ffff9329c579c000 RCX: 0000010000000006
\[   44.546523\] RDX: 000000000000003c RSI: ffffb342008b79f0 RDI: ffff9329c158e738
\[   44.546523\] RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
\[   44.546523\] R10: 00007ffffffff000 R11: ffffffff9bd0d910 R12: 0000006210000000
\[   44.546523\] R13: fffffc7e4015e700 R14: 0000010000000005 R15: ffff9329c158e738
\[   44.546523\] FS:  00007f4299934740(0000) GS:ffff932a60179000(0000) knlGS:0000000000000000
\[   44.546523\] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
\[   44.546523\] CR2: 00007f4299a1ec90 CR3: 0000000002886002 CR4: 0000000000770eb0
\[   44.546523\] PKRU: 55555554
\[   44.546523\] Call Trace:
\[   44.546523\]  \<TASK\>
\[   44.546523\]  ext4\_write\_inline\_data\_end+0x126/0x2d0
\[   44.546523\]  generic\_perform\_write+0x17e/0x270
\[   44.546523\]  ext4\_buffered\_write\_iter+0xc8/0x170
\[   44.546523\]  vfs\_write+0x2be/0x3e0
\[   44.546523\]  \_\_x64\_sys\_pwrite64+0x6d/0xc0
\[   44.546523\]  do\_syscall\_64+0x6a/0xf0
\[   44.546523\]  ? \_\_wake\_up+0x89/0xb0
\[   44.546523\]  ? xas\_find+0x72/0x1c0
\[   44.546523\]  ? next\_uptodate\_folio+0x317/0x330
\[   44.546523\]  ? set\_pte\_range+0x1a6/0x270
\[   44.546523\]  ? filemap\_map\_pages+0x6ee/0x840
\[   44.546523\]  ? ext4\_setattr+0x2fa/0x750
\[   44.546523\]  ? do\_pte\_missing+0x128/0xf70
\[   44.546523\]  ? security\_inode\_post\_setattr+0x3e/0xd0
\[   44.546523\]  ? \_\_\_pte\_offset\_map+0x19/0x100
\[   44.546523\]  ? handle\_mm\_fault+0x721/0xa10
\[   44.546523\]  ? do\_user\_addr\_fault+0x197/0x730
\[   44.546523\]  ? do\_syscall\_64+0x76/0xf0
\[   44.546523\]  ? arch\_exit\_to\_user\_mode\_prepare+0x1e/0x60
\[   44.546523\]  ? irqentry\_exit\_to\_user\_mode+0x79/0x90
\[   44.546523\]  entry\_SYSCALL\_64\_after\_hwframe+0x55/0x5d
\[   44.546523\] RIP: 0033:0x7f42999c6687
\[   44.546523\] Code: 48 89 fa 4c 89 df e8 58 b3 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 \<5b\> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
\[   44.546523\] RSP: 002b:00007ffeae4a7930 EFLAGS: 00000202 ORIG\_RAX: 0000000000000012
\[   44.546523\] RAX: ffffffffffffffda RBX: 00007f4299934740 RCX: 00007f42999c6687
\[   44.546523\] RDX: 0000000000000001 RSI: 000055ea6149200f RDI: 0000000000000003
\[   44.546523\] RBP: 00007ffeae4a79a0 R08: 0000000000000000 R09: 0000000000000000
\[   44.546523\] R10: 0000010000000005 R11: 0000000000000202 R12: 0000
---truncated---

## Affected and fixed versions

- Linux: \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< d3dfc60efd145df5324b99a244b0b05505cde29b; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 717414a8c083c376d4a8940a1230fe0c6ed4ee00; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 9d1d1c5bf4fc1af76be154d3afb2acdbd89ec7d8; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< cf5f319a2d8ab8238f8cf3a19463b9bff6420934; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 26e09d18599da0adc543eabd300080daaeda6869; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 5766da2237e539f259aa0e5f3639ae37b44ca458; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< e80ee0263d88d77f2fd1927f915003a7066cbb50; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 227cb4ca5a6502164f850d22aec3104d7888b270 (cvelist)
- Linux: 3.8 (cvelist)

## Mitigation

- Upgrade Linux to 227cb4ca5a6502164f850d22aec3104d7888b270 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-38222.md
Affected: Linux >= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, < d3dfc60efd145df5324b99a244b0b05505cde29b; >= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, < 717414a8c083c376d4a8940a1230fe0c6ed4ee00; >= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, < 9d1d1c5bf4fc1af76be154d3afb2acdbd89ec7d8; >= f19d5870cbf72d4cb2a8e1f…
Fixed in: Linux 717414a8c083c376d4a8940a1230fe0c6ed4ee00, Linux 9d1d1c5bf4fc1af76be154d3afb2acdbd89ec7d8, Linux 26e09d18599da0adc543eabd300080daaeda6869, Linux 5766da2237e539f259aa0e5f3639ae37b44ca458, Linux 227cb4ca5a6502164f850d22aec3104d7888b270

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-2025-38222 being exploited?

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

### How serious is CVE-2025-38222?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2025-38222?

Linux \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< d3dfc60efd145df5324b99a244b0b05505cde29b; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 717414a8c083c376d4a8940a1230fe0c6ed4ee00; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 9d1d1c5bf4fc1af76be154d3afb2acdbd89ec7d8; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< cf5f319a2d8ab8238f8cf3a19463b9bff6420934; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 26e09d18599da0adc543eabd300080daaeda6869; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 5766da2237e539f259aa0e5f3639ae37b44ca458; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< e80ee0263d88d77f2fd1927f915003a7066cbb50; \>= f19d5870cbf72d4cb2a8e1f749dff97af99b071e, \< 227cb4ca5a6502164f850d22aec3104d7888b270; Linux 3.8.

### Is there a fix for CVE-2025-38222?

Yes. Fixed in Linux 717414a8c083c376d4a8940a1230fe0c6ed4ee00, Linux 9d1d1c5bf4fc1af76be154d3afb2acdbd89ec7d8, Linux 26e09d18599da0adc543eabd300080daaeda6869, Linux 5766da2237e539f259aa0e5f3639ae37b44ca458, Linux 227cb4ca5a6502164f850d22aec3104d7888b270. Upgrade Linux to 227cb4ca5a6502164f850d22aec3104d7888b270 or later.

### How do I check if I'm affected by CVE-2025-38222?

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

- patch: <https://git.kernel.org/stable/c/d3dfc60efd145df5324b99a244b0b05505cde29b>
- patch: <https://git.kernel.org/stable/c/717414a8c083c376d4a8940a1230fe0c6ed4ee00>
- patch: <https://git.kernel.org/stable/c/9d1d1c5bf4fc1af76be154d3afb2acdbd89ec7d8>
- patch: <https://git.kernel.org/stable/c/cf5f319a2d8ab8238f8cf3a19463b9bff6420934>
- patch: <https://git.kernel.org/stable/c/26e09d18599da0adc543eabd300080daaeda6869>
- patch: <https://git.kernel.org/stable/c/5766da2237e539f259aa0e5f3639ae37b44ca458>
- patch: <https://git.kernel.org/stable/c/e80ee0263d88d77f2fd1927f915003a7066cbb50>
- patch: <https://git.kernel.org/stable/c/227cb4ca5a6502164f850d22aec3104d7888b270>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-082556.html>

## 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-2025-38222>

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