# CVE-2022-50435: ext4: avoid crash when inline data creation follows DIO write

> 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.22% (percentile 7, 2026-11-26)
- **Published:** 2025-10-01T11:42:12.845Z
- **Modified:** 2026-11-05T21:16:58.937Z

## Who should check

- Anyone running Linux \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< fb98cb61efff3b2a1964939465ccaaf906af1d4f; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< d8e4af8314df54d94cf2a541cf9c8626afe81d41; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 89db2b50469bdbccb06ab072096d9d403124abac; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 771f15782d95760cde352c8d4bfd6f2c70719568; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 4bb26f2885ac6930984ee451b952c5a6042f2c0e
- Anyone running Linux 5.5

## Description

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

ext4: avoid crash when inline data creation follows DIO write

When inode is created and written to using direct IO, there is nothing
to clear the EXT4\_STATE\_MAY\_INLINE\_DATA flag. Thus when inode gets
truncated later to say 1 byte and written using normal write, we will
try to store the data as inline data. This confuses the code later
because the inode now has both normal block and inline data allocated
and the confusion manifests for example as:

kernel BUG at fs/ext4/inode.c:2721!
invalid opcode: 0000 \[\#1\] PREEMPT SMP KASAN
CPU: 0 PID: 359 Comm: repro Not tainted 5.19.0-rc8-00001-g31ba1e3b8305-dirty \#15
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.0-1.fc36 04/01/2014
RIP: 0010:ext4\_writepages+0x363d/0x3660
RSP: 0018:ffffc90000ccf260 EFLAGS: 00010293
RAX: ffffffff81e1abcd RBX: 0000008000000000 RCX: ffff88810842a180
RDX: 0000000000000000 RSI: 0000008000000000 RDI: 0000000000000000
RBP: ffffc90000ccf650 R08: ffffffff81e17d58 R09: ffffed10222c680b
R10: dfffe910222c680c R11: 1ffff110222c680a R12: ffff888111634128
R13: ffffc90000ccf880 R14: 0000008410000000 R15: 0000000000000001
FS:  00007f72635d2640(0000) GS:ffff88811b000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000565243379180 CR3: 000000010aa74000 CR4: 0000000000150eb0
Call Trace:
 \<TASK\>
 do\_writepages+0x397/0x640
 filemap\_fdatawrite\_wbc+0x151/0x1b0
 file\_write\_and\_wait\_range+0x1c9/0x2b0
 ext4\_sync\_file+0x19e/0xa00
 vfs\_fsync\_range+0x17b/0x190
 ext4\_buffered\_write\_iter+0x488/0x530
 ext4\_file\_write\_iter+0x449/0x1b90
 vfs\_write+0xbcd/0xf40
 ksys\_write+0x198/0x2c0
 \_\_x64\_sys\_write+0x7b/0x90
 do\_syscall\_64+0x3d/0x90
 entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd
 \</TASK\>

Fix the problem by clearing EXT4\_STATE\_MAY\_INLINE\_DATA when we are doing
direct IO write to a file.

## Affected and fixed versions

- Linux: \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< fb98cb61efff3b2a1964939465ccaaf906af1d4f; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< d8e4af8314df54d94cf2a541cf9c8626afe81d41; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 89db2b50469bdbccb06ab072096d9d403124abac; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 771f15782d95760cde352c8d4bfd6f2c70719568; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 4bb26f2885ac6930984ee451b952c5a6042f2c0e (cvelist)
- Linux: 5.5 (cvelist)

## Mitigation

- Upgrade Linux to 4bb26f2885ac6930984ee451b952c5a6042f2c0e 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-50435. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-50435.md
Affected: Linux >= 378f32bab3714f04c4e0c3aee4129f6703805550, < fb98cb61efff3b2a1964939465ccaaf906af1d4f; >= 378f32bab3714f04c4e0c3aee4129f6703805550, < d8e4af8314df54d94cf2a541cf9c8626afe81d41; >= 378f32bab3714f04c4e0c3aee4129f6703805550, < 89db2b50469bdbccb06ab072096d9d403124abac; >= 378f32bab3714f04c4e0c3a…
Fixed in: Linux 89db2b50469bdbccb06ab072096d9d403124abac, Linux 771f15782d95760cde352c8d4bfd6f2c70719568, Linux 4bb26f2885ac6930984ee451b952c5a6042f2c0e

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-50435 being exploited?

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

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

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

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

Linux \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< fb98cb61efff3b2a1964939465ccaaf906af1d4f; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< d8e4af8314df54d94cf2a541cf9c8626afe81d41; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 89db2b50469bdbccb06ab072096d9d403124abac; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 771f15782d95760cde352c8d4bfd6f2c70719568; \>= 378f32bab3714f04c4e0c3aee4129f6703805550, \< 4bb26f2885ac6930984ee451b952c5a6042f2c0e; Linux 5.5.

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

Yes. Fixed in Linux 89db2b50469bdbccb06ab072096d9d403124abac, Linux 771f15782d95760cde352c8d4bfd6f2c70719568, Linux 4bb26f2885ac6930984ee451b952c5a6042f2c0e. Upgrade Linux to 4bb26f2885ac6930984ee451b952c5a6042f2c0e or later.

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

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/fb98cb61efff3b2a1964939465ccaaf906af1d4f>
- patch: <https://git.kernel.org/stable/c/d8e4af8314df54d94cf2a541cf9c8626afe81d41>
- patch: <https://git.kernel.org/stable/c/89db2b50469bdbccb06ab072096d9d403124abac>
- patch: <https://git.kernel.org/stable/c/771f15782d95760cde352c8d4bfd6f2c70719568>
- patch: <https://git.kernel.org/stable/c/4bb26f2885ac6930984ee451b952c5a6042f2c0e>

## 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-50435>

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