# CVE-2021-47406: ext4: add error checking to ext4\_ext\_replay\_set\_iblocks()

> 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, CNA) `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 16, 2026-11-26)
- **CWE:** CWE-835
- **Published:** 2024-05-21T15:03:59.334Z
- **Modified:** 2026-06-17T04:17:24.020Z

## Who should check

- Anyone running Linux \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< a63474dbf692dd09b50fed592bc41f6de5f102fc; \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< 27e10c5d31ff1d222c7f797f1ee96d422859ba67; \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< 1fd95c05d8f742abfe906620780aee4dbe1a2db0
- Anyone running Linux 5.10

## Description

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

ext4: add error checking to ext4\_ext\_replay\_set\_iblocks()

If the call to ext4\_map\_blocks() fails due to an corrupted file
system, ext4\_ext\_replay\_set\_iblocks() can get stuck in an infinite
loop.  This could be reproduced by running generic/526 with a file
system that has inline\_data and fast\_commit enabled.  The system will
repeatedly log to the console:

EXT4-fs warning (device dm-3): ext4\_block\_to\_path:105: block 1074800922 \> max in inode 131076

and the stack that it gets stuck in is:

   ext4\_block\_to\_path+0xe3/0x130
   ext4\_ind\_map\_blocks+0x93/0x690
   ext4\_map\_blocks+0x100/0x660
   skip\_hole+0x47/0x70
   ext4\_ext\_replay\_set\_iblocks+0x223/0x440
   ext4\_fc\_replay\_inode+0x29e/0x3b0
   ext4\_fc\_replay+0x278/0x550
   do\_one\_pass+0x646/0xc10
   jbd2\_journal\_recover+0x14a/0x270
   jbd2\_journal\_load+0xc4/0x150
   ext4\_load\_journal+0x1f3/0x490
   ext4\_fill\_super+0x22d4/0x2c00

With this patch, generic/526 still fails, but system is no longer
locking up in a tight loop.  It's likely the root casue is that
fast\_commit replay is corrupting file systems with inline\_data, and we
probably need to add better error handling in the fast commit replay
code path beyond what is done here, which essentially just breaks the
infinite loop without reporting the to the higher levels of the code.

## Affected and fixed versions

- Linux: \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< a63474dbf692dd09b50fed592bc41f6de5f102fc; \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< 27e10c5d31ff1d222c7f797f1ee96d422859ba67; \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< 1fd95c05d8f742abfe906620780aee4dbe1a2db0 (cvelist)
- Linux: 5.10 (cvelist)

## Mitigation

- Upgrade Linux to 1fd95c05d8f742abfe906620780aee4dbe1a2db0 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47406.md
Affected: Linux >= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, < a63474dbf692dd09b50fed592bc41f6de5f102fc; >= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, < 27e10c5d31ff1d222c7f797f1ee96d422859ba67; >= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, < 1fd95c05d8f742abfe906620780aee4dbe1a2db0; Linux 5.10
Fixed in: Linux 27e10c5d31ff1d222c7f797f1ee96d422859ba67, Linux 1fd95c05d8f742abfe906620780aee4dbe1a2db0

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-2021-47406 being exploited?

There is no confirmed exploitation: CVE-2021-47406 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-2021-47406?

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

### Which versions are affected by CVE-2021-47406?

Linux \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< a63474dbf692dd09b50fed592bc41f6de5f102fc; \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< 27e10c5d31ff1d222c7f797f1ee96d422859ba67; \>= 8016e29f4362e285f0f7e38fadc61a5b7bdfdfa2, \< 1fd95c05d8f742abfe906620780aee4dbe1a2db0; Linux 5.10.

### Is there a fix for CVE-2021-47406?

Yes. Fixed in Linux 27e10c5d31ff1d222c7f797f1ee96d422859ba67, Linux 1fd95c05d8f742abfe906620780aee4dbe1a2db0. Upgrade Linux to 1fd95c05d8f742abfe906620780aee4dbe1a2db0 or later.

### How do I check if I'm affected by CVE-2021-47406?

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/a63474dbf692dd09b50fed592bc41f6de5f102fc>
- patch: <https://git.kernel.org/stable/c/27e10c5d31ff1d222c7f797f1ee96d422859ba67>
- patch: <https://git.kernel.org/stable/c/1fd95c05d8f742abfe906620780aee4dbe1a2db0>

## 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-2021-47406>

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