# CVE-2022-49349: ext4: fix use-after-free in ext4\_rename\_dir\_prepare

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-02-26T02:11:02.993Z
- **Modified:** 2026-08-05T08:54:51.229Z

## Who should check

- Anyone running Linux \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 1a3a15bf6f9963d755270cbdb282863b84839195; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 97f802a652a749422dede32071d29a53cf4bd034; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 10801095224de0d0ab06ae60698680c1f883a3ae; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< eaecf7ebfd5dd09038a80b14be46b844f54cfc5c; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< dd887f83ea54aea5b780a84527e23ab95f777fed; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 364380c00912bed9b5d99eb485018360b0ecf64f; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 0ff38b99fa075ddd246487a28cb9af049f4ceef1; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 4a2bea60cf7ff957b3eda0b17750d483876a02fa; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 0be698ecbe4471fcad80e81ec6a05001421041b3
- Anyone running Linux 3.8

## Description

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

ext4: fix use-after-free in ext4\_rename\_dir\_prepare

We got issue as follows:
EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue
ext4\_get\_first\_dir\_block: bh-\>b\_data=0xffff88810bee6000 len=34478
ext4\_get\_first\_dir\_block: \*parent\_de=0xffff88810beee6ae bh-\>b\_data=0xffff88810bee6000
ext4\_rename\_dir\_prepare: \[1\] parent\_de=0xffff88810beee6ae
==================================================================
BUG: KASAN: use-after-free in ext4\_rename\_dir\_prepare+0x152/0x220
Read of size 4 at addr ffff88810beee6ae by task rep/1895

CPU: 13 PID: 1895 Comm: rep Not tainted 5.10.0+ \#241
Call Trace:
 dump\_stack+0xbe/0xf9
 print\_address\_description.constprop.0+0x1e/0x220
 kasan\_report.cold+0x37/0x7f
 ext4\_rename\_dir\_prepare+0x152/0x220
 ext4\_rename+0xf44/0x1ad0
 ext4\_rename2+0x11c/0x170
 vfs\_rename+0xa84/0x1440
 do\_renameat2+0x683/0x8f0
 \_\_x64\_sys\_renameat+0x53/0x60
 do\_syscall\_64+0x33/0x40
 entry\_SYSCALL\_64\_after\_hwframe+0x44/0xa9
RIP: 0033:0x7f45a6fc41c9
RSP: 002b:00007ffc5a470218 EFLAGS: 00000246 ORIG\_RAX: 0000000000000108
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f45a6fc41c9
RDX: 0000000000000005 RSI: 0000000020000180 RDI: 0000000000000005
RBP: 00007ffc5a470240 R08: 00007ffc5a470160 R09: 0000000020000080
R10: 00000000200001c0 R11: 0000000000000246 R12: 0000000000400bb0
R13: 00007ffc5a470320 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the page:
page:00000000440015ce refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x10beee
flags: 0x200000000000000()
raw: 0200000000000000 ffffea00043ff4c8 ffffea0004325608 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88810beee580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee600: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
\>ffff88810beee680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                  ^
 ffff88810beee700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88810beee780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
Disabling lock debugging due to kernel taint
ext4\_rename\_dir\_prepare: \[2\] parent\_de-\>inode=3537895424
ext4\_rename\_dir\_prepare: \[3\] dir=0xffff888124170140
ext4\_rename\_dir\_prepare: \[4\] ino=2
ext4\_rename\_dir\_prepare: ent-\>dir-\>i\_ino=2 parent=-757071872

Reason is first directory entry which 'rec\_len' is 34478, then will get illegal
parent entry. Now, we do not check directory entry after read directory block
in 'ext4\_get\_first\_dir\_block'.
To solve this issue, check directory entry in 'ext4\_get\_first\_dir\_block'.

\[ Trigger an ext4\_error() instead of just warning if the directory is
  missing a '.' or '..' entry.   Also make sure we return an error code
  if the file system is corrupted.  -TYT \]

## Affected and fixed versions

- Linux: \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 1a3a15bf6f9963d755270cbdb282863b84839195; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 97f802a652a749422dede32071d29a53cf4bd034; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 10801095224de0d0ab06ae60698680c1f883a3ae; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< eaecf7ebfd5dd09038a80b14be46b844f54cfc5c; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< dd887f83ea54aea5b780a84527e23ab95f777fed; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 364380c00912bed9b5d99eb485018360b0ecf64f; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 0ff38b99fa075ddd246487a28cb9af049f4ceef1; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 4a2bea60cf7ff957b3eda0b17750d483876a02fa; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 0be698ecbe4471fcad80e81ec6a05001421041b3 (cvelist)
- Linux: 3.8 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-49349.md
Affected: Linux >= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, < 1a3a15bf6f9963d755270cbdb282863b84839195; >= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, < 97f802a652a749422dede32071d29a53cf4bd034; >= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, < 10801095224de0d0ab06ae60698680c1f883a3ae; >= 32f7f22c0b52e8189fef839…
Fixed in: Linux 1a3a15bf6f9963d755270cbdb282863b84839195, Linux 97f802a652a749422dede32071d29a53cf4bd034, Linux 10801095224de0d0ab06ae60698680c1f883a3ae, Linux 364380c00912bed9b5d99eb485018360b0ecf64f, Linux 0ff38b99fa075ddd246487a28cb9af049f4ceef1, Linux 4a2bea60cf7ff957b3eda0b17750d483876a02fa, Linux 0be69…

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

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

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

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.

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

Linux \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 1a3a15bf6f9963d755270cbdb282863b84839195; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 97f802a652a749422dede32071d29a53cf4bd034; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 10801095224de0d0ab06ae60698680c1f883a3ae; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< eaecf7ebfd5dd09038a80b14be46b844f54cfc5c; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< dd887f83ea54aea5b780a84527e23ab95f777fed; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 364380c00912bed9b5d99eb485018360b0ecf64f; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 0ff38b99fa075ddd246487a28cb9af049f4ceef1; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 4a2bea60cf7ff957b3eda0b17750d483876a02fa; \>= 32f7f22c0b52e8189fef83986b16dc7abe95f2c4, \< 0be698ecbe4471fcad80e81ec6a05001421041b3; Linux 3.8.

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

Yes. Fixed in Linux 1a3a15bf6f9963d755270cbdb282863b84839195, Linux 97f802a652a749422dede32071d29a53cf4bd034, Linux 10801095224de0d0ab06ae60698680c1f883a3ae, Linux 364380c00912bed9b5d99eb485018360b0ecf64f, Linux 0ff38b99fa075ddd246487a28cb9af049f4ceef1, Linux 4a2bea60cf7ff957b3eda0b17750d483876a02fa, Linux 0be698ecbe4471fcad80e81ec6a05001421041b3. Upgrade Linux to 0be698ecbe4471fcad80e81ec6a05001421041b3 or later.

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

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/1a3a15bf6f9963d755270cbdb282863b84839195>
- patch: <https://git.kernel.org/stable/c/97f802a652a749422dede32071d29a53cf4bd034>
- patch: <https://git.kernel.org/stable/c/10801095224de0d0ab06ae60698680c1f883a3ae>
- patch: <https://git.kernel.org/stable/c/eaecf7ebfd5dd09038a80b14be46b844f54cfc5c>
- patch: <https://git.kernel.org/stable/c/dd887f83ea54aea5b780a84527e23ab95f777fed>
- patch: <https://git.kernel.org/stable/c/364380c00912bed9b5d99eb485018360b0ecf64f>
- patch: <https://git.kernel.org/stable/c/0ff38b99fa075ddd246487a28cb9af049f4ceef1>
- patch: <https://git.kernel.org/stable/c/4a2bea60cf7ff957b3eda0b17750d483876a02fa>
- patch: <https://git.kernel.org/stable/c/0be698ecbe4471fcad80e81ec6a05001421041b3>

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

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