CVE-2021-47460

ocfs2: fix data corruption after conversion from inline format

MEDIUM
5.5
CVSS Score
Published: May 22, 2024 at 06:23 AM UTC
Updated: June 17, 2026 at 04:17 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.2%
SSVC
No known exploit

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. [[email protected]: fix whitespace, per Joseph]

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 5.9.54.14.204 ≤ v < 4.14.2534.19.155 ≤ v < 4.19.2144.9.242 ≤ v < 4.9.2885.10 ≤ v < 5.10.765.10 ≤ v < 5.14.155.10 ≤ v < 5.155.11 ≤ v < 5.14.155.4.75 ≤ v < 5.4.1565.9.5 ≤ v < 5.105.9.5 ≤ v < 5.10.7636ed9e604215f58cec0381ca5fcc6da05f2d87ca4.14.2044.19.1554.9.2425.105.15 rc15.15 rc25.15 rc35.15 rc45.15 rc55.15 rc65.4.755.9.56dbf7bb555981fb5faf7b691e8f6169fc2b2e63b7ce2b16bad2cbfa3fa7bbc42c4448914f639ca477ed80e77c908cbaa686529a49f8ae0060c5caee7acef5107e2eacb08a16ad5db60320d65bd26a6c0f8a6a2ed4b7d1c3c8631eeb6d00572bc853094a8
Vendor states this is fixed in 5314454ea3ff6fc746eaf71b9a7ceebed52888fa (fixed)
Vendor states this is fixed in 560edd14de2bf9dbc0129681eeb4d5ef87cc105f (fixed)
Vendor states this is fixed in 8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e (fixed)
Vendor states this is fixed in a3a089c241cd49b33a8cdd7fcb37cc87a086912a (fixed)
Vendor states this is fixed in b05caf023b14cbed9223bb5b48ecc7bffe38f632 (fixed)
Vendor states this is fixed in f1b98569e81c37d7e0deada7172f8f60860c1360 (fixed)
Vendor states this is fixed in fa9b6b6c953e3f6441ed6cf83b4c771dac2dae08 (fixed)
Vendor states this is fixed in 4.14.253 (unaffected)
Vendor states this is fixed in 4.19.214 (unaffected)
Vendor states this is fixed in 4.9.288 (unaffected)
Vendor states this is fixed in 5.10 (unaffected)
Vendor states this is fixed in 5.10.76 (unaffected)
Vendor states this is fixed in 5.14.15 (unaffected)
Vendor states this is fixed in 5.15 (unaffected)
Vendor states this is fixed in 5.4.156 (unaffected)

References (7)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/5314454ea3ff6fc746eaf71b9a7ceebed52888fa
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/560edd14de2bf9dbc0129681eeb4d5ef87cc105f
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/8e6bfb4f70168ddfd32fb6dc028ad52faaf1f32e
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/a3a089c241cd49b33a8cdd7fcb37cc87a086912a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/b05caf023b14cbed9223bb5b48ecc7bffe38f632
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/f1b98569e81c37d7e0deada7172f8f60860c1360
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/fa9b6b6c953e3f6441ed6cf83b4c771dac2dae08

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
NVD-CWE-Other

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card