CVE-2021-47460 json
ocfs2: fix data corruption after conversion from inline format
published 2024-05-22 2 y ago modified 2026-06-17 4 mo ago also EUVD-2021-34465
- cvss
- 5.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.2%
- EPSS 0.2% chance of exploitation in 30 days, percentile 11%
- public exploits
- 0
- none known
Summary
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]
Patch / fix
- Linux Linux 4.9.288, 4.14.253, 4.19.214, 5.4.156, 5.10, 5.10.76, 5.14.15, 5.15
- linux Debian 14, Debian 13, Debian 12 5.14.16-1
debian advisories DEBIAN-CVE-2021-47460
- linux Ubuntu 18.04 LTS 4.15.0-166.174
- linux Ubuntu 20.04 LTS 5.4.0-92.103
- linux-aws Ubuntu 18.04 LTS 4.15.0-1118.125
- linux-aws Ubuntu 20.04 LTS 5.4.0-1061.64
- linux-gcp Ubuntu 20.04 LTS 5.4.0-1059.63
- linux-ibm Ubuntu 20.04 LTS 5.4.0-1010.11
- linux-kvm Ubuntu 18.04 LTS 4.15.0-1105.107
- linux-kvm Ubuntu 20.04 LTS 5.4.0-1051.53
ubuntu advisories UBUNTU-CVE-2021-47460
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- dtb-aarch64 openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-64kb SLE Module for Basesystem 15 SP5, openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-syms SLE Module for Development Tools 15 SP5, openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-obs-qa openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-source SLE Module for Development Tools 15 SP5, SLE Module for Basesystem 15 SP5, openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-default SLE Workstation Extension 15 SP5, SLE Module for Legacy 15 SP5, SLE Module for Basesystem 15 SP5 +4 more 5.14.21-150500.55.68.1
- kernel-kvmsmall openSUSE Leap 15.5 5.14.21-150500.55.68.1
- kernel-zfcpdump SLE Module for Basesystem 15 SP5, openSUSE Leap 15.5 5.14.21-150500.55.68.1
suse advisories SUSE-SU-2024:2190-1SUSE-SU-2024:2189-1SUSE-SU-2024:2185-1SUSE-SU-2024:2184-1SUSE-SU-2024:2183-1SUSE-SU-2024:2019-1
- git.kernel.org/stable/c/560edd14de2bf9dbc0129681eeb4d5ef87cc105f commit
- git.kernel.org/stable/c/8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e commit
- git.kernel.org/stable/c/a3a089c241cd49b33a8cdd7fcb37cc87a086912a commit
- git.kernel.org/stable/c/b05caf023b14cbed9223bb5b48ecc7bffe38f632 commit
- git.kernel.org/stable/c/f1b98569e81c37d7e0deada7172f8f60860c1360 commit
- git.kernel.org/stable/c/fa9b6b6c953e3f6441ed6cf83b4c771dac2dae08 commit
- git.kernel.org/stable/c/5314454ea3ff6fc746eaf71b9a7ceebed52888fa commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-47460 updated cvss 6.1
kernel: ocfs2: fix data corruption after conversion from inline format
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more Red Hat Enterprise Linux 10 kernelnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.21% chance of exploitation in the next 30 days, higher than 11% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected products
- Linux Linux
Classification
- Technology feeds
References
-
git.kernel.org
/stable/c/560edd14de2bf9dbc0129681eeb4d5ef87cc105f
patch
-
git.kernel.org
/stable/c/8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e
patch
-
git.kernel.org
/stable/c/a3a089c241cd49b33a8cdd7fcb37cc87a086912a
patch
-
git.kernel.org
/stable/c/b05caf023b14cbed9223bb5b48ecc7bffe38f632
patch
-
git.kernel.org
/stable/c/f1b98569e81c37d7e0deada7172f8f60860c1360
patch
-
git.kernel.org
/stable/c/fa9b6b6c953e3f6441ed6cf83b4c771dac2dae08
patch
-
git.kernel.org
/stable/c/5314454ea3ff6fc746eaf71b9a7ceebed52888fa
patch
Sources
- CVE List CVE-2021-47460
- NVD CVE-2021-47460
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.