# CVE-2021-47460: ocfs2: fix data corruption after conversion from inline format

> 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.31% (percentile 16, 2026-11-26)
- **Published:** 2024-05-22T06:23:21.724Z
- **Modified:** 2026-06-17T04:17:31.570Z

## Who should check

- Anyone running Linux \>= acef5107e2eacb08a16ad5db60320d65bd26a6c0, \< 560edd14de2bf9dbc0129681eeb4d5ef87cc105f; \>= 7ed80e77c908cbaa686529a49f8ae0060c5caee7, \< 8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e; \>= 7ce2b16bad2cbfa3fa7bbc42c4448914f639ca47, \< a3a089c241cd49b33a8cdd7fcb37cc87a086912a; \>= f8a6a2ed4b7d1c3c8631eeb6d00572bc853094a8, \< b05caf023b14cbed9223bb5b48ecc7bffe38f632; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< f1b98569e81c37d7e0deada7172f8f60860c1360; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< fa9b6b6c953e3f6441ed6cf83b4c771dac2dae08; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< 5314454ea3ff6fc746eaf71b9a7ceebed52888fa; 36ed9e604215f58cec0381ca5fcc6da05f2d87ca; \>= 4.9.242, \< 4.9.288; \>= 4.14.204, \< 4.14.253; …
- Anyone running Linux 5.10

## Description

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

ocfs2: fix data corruption after conversion from inline format

Commit 6dbf7bb55598 ("fs: Don't invalidate page buffers in
block\_write\_full\_page()") uncovered a latent bug in ocfs2 conversion
from inline inode format to a normal inode format.

The code in ocfs2\_convert\_inline\_data\_to\_extents() attempts to zero out
the whole cluster allocated for file data by grabbing, zeroing, and
dirtying all pages covering this cluster.  However these pages are
beyond i\_size, thus writeback code generally ignores these dirty pages
and no blocks were ever actually zeroed on the disk.

This oversight was fixed by commit 693c241a5f6a ("ocfs2: No need to zero
pages past i\_size.") for standard ocfs2 write path, inline conversion
path was apparently forgotten; the commit log also has a reasoning why
the zeroing actually is not needed.

After commit 6dbf7bb55598, things became worse as writeback code stopped
invalidating buffers on pages beyond i\_size and thus these pages end up
with clean PageDirty bit but with buffers attached to these pages being
still dirty.  So when a file is converted from inline format, then
writeback triggers, and then the file is grown so that these pages
become valid, the invalid dirtiness state is preserved,
mark\_buffer\_dirty() does nothing on these pages (buffers are already
dirty) but page is never written back because it is clean.  So data
written to these pages is lost once pages are reclaimed.

Simple reproducer for the problem is:

  xfs\_io -f -c "pwrite 0 2000" -c "pwrite 2000 2000" -c "fsync" \\
    -c "pwrite 4000 2000" ocfs2\_file

After unmounting and mounting the fs again, you can observe that end of
'ocfs2\_file' has lost its contents.

Fix the problem by not doing the pointless zeroing during conversion
from inline format similarly as in the standard write path.

\[akpm@linux-foundation.org: fix whitespace, per Joseph\]

## Affected and fixed versions

- Linux: \>= acef5107e2eacb08a16ad5db60320d65bd26a6c0, \< 560edd14de2bf9dbc0129681eeb4d5ef87cc105f; \>= 7ed80e77c908cbaa686529a49f8ae0060c5caee7, \< 8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e; \>= 7ce2b16bad2cbfa3fa7bbc42c4448914f639ca47, \< a3a089c241cd49b33a8cdd7fcb37cc87a086912a; \>= f8a6a2ed4b7d1c3c8631eeb6d00572bc853094a8, \< b05caf023b14cbed9223bb5b48ecc7bffe38f632; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< f1b98569e81c37d7e0deada7172f8f60860c1360; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< fa9b6b6c953e3f6441ed6cf83b4c771dac2dae08; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< 5314454ea3ff6fc746eaf71b9a7ceebed52888fa; 36ed9e604215f58cec0381ca5fcc6da05f2d87ca; \>= 4.9.242, \< 4.9.288; \>= 4.14.204, \< 4.14.253; … (cvelist)
- Linux: 5.10 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47460.md
Affected: Linux >= acef5107e2eacb08a16ad5db60320d65bd26a6c0, < 560edd14de2bf9dbc0129681eeb4d5ef87cc105f; >= 7ed80e77c908cbaa686529a49f8ae0060c5caee7, < 8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e; >= 7ce2b16bad2cbfa3fa7bbc42c4448914f639ca47, < a3a089c241cd49b33a8cdd7fcb37cc87a086912a; >= f8a6a2ed4b7d1c3c8631eeb…
Fixed in: Linux 560edd14de2bf9dbc0129681eeb4d5ef87cc105f, Linux 8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e, Linux 5314454ea3ff6fc746eaf71b9a7ceebed52888fa, Linux 4.9.288, Linux 4.14.253

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

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

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

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

Linux \>= acef5107e2eacb08a16ad5db60320d65bd26a6c0, \< 560edd14de2bf9dbc0129681eeb4d5ef87cc105f; \>= 7ed80e77c908cbaa686529a49f8ae0060c5caee7, \< 8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e; \>= 7ce2b16bad2cbfa3fa7bbc42c4448914f639ca47, \< a3a089c241cd49b33a8cdd7fcb37cc87a086912a; \>= f8a6a2ed4b7d1c3c8631eeb6d00572bc853094a8, \< b05caf023b14cbed9223bb5b48ecc7bffe38f632; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< f1b98569e81c37d7e0deada7172f8f60860c1360; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< fa9b6b6c953e3f6441ed6cf83b4c771dac2dae08; \>= 6dbf7bb555981fb5faf7b691e8f6169fc2b2e63b, \< 5314454ea3ff6fc746eaf71b9a7ceebed52888fa; 36ed9e604215f58cec0381ca5fcc6da05f2d87ca; \>= 4.9.242, \< 4.9.288; \>= 4.14.204, \< 4.14.253; …; Linux 5.10.

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

Yes. Fixed in Linux 560edd14de2bf9dbc0129681eeb4d5ef87cc105f, Linux 8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e, Linux 5314454ea3ff6fc746eaf71b9a7ceebed52888fa, Linux 4.9.288, Linux 4.14.253. No fix listed yet: follow the vendor advisory.

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

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/560edd14de2bf9dbc0129681eeb4d5ef87cc105f>
- patch: <https://git.kernel.org/stable/c/8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e>
- patch: <https://git.kernel.org/stable/c/a3a089c241cd49b33a8cdd7fcb37cc87a086912a>
- patch: <https://git.kernel.org/stable/c/b05caf023b14cbed9223bb5b48ecc7bffe38f632>
- patch: <https://git.kernel.org/stable/c/f1b98569e81c37d7e0deada7172f8f60860c1360>
- patch: <https://git.kernel.org/stable/c/fa9b6b6c953e3f6441ed6cf83b4c771dac2dae08>
- patch: <https://git.kernel.org/stable/c/5314454ea3ff6fc746eaf71b9a7ceebed52888fa>

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

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