CVE-2021-47114: ocfs2: fix data corruption by fallocate
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: fix data corruption by fallocate
When fallocate punches holes out of inode size, if original isize is in
the middle of last cluster, then the part from isize to the end of the
cluster will be zeroed with buffer write, at that time isize is not yet
updated to match the new size, if writeback is kicked in, it will invoke
ocfs2_writepage()->block_write_full_page() where the pages out of inode
size will be dropped. That will cause file corruption. Fix this by
zero out eof blocks when extending the inode size.
Running the following command with qemu-image 4.2.1 can get a corrupted
coverted image file easily.
qemu-img convert -p -t none -T none -f qcow2 $qcow_image \
-O qcow2 -o compat=1.1 $qcow_image.conv
The usage of fallocate in qemu is like this, it first punches holes out
of inode size, then extend the inode size.
fallocate(11, FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE, 2276196352, 65536) = 0
fallocate(11, 0, 2276196352, 65536) = 0
v1: https://www.spinics.net/lists/linux-fsdevel/msg193999.html
v2: https://lore.kernel.org/linux-fsdevel/20210525093034.GB4112@quack2.suse.cz/T/
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel OCFS2 filesystem bug that can corrupt files during specific fallocate operations. The business risk is data reliability, not remote compromise. The CVE is medium severity, local, and requires some local privilege, but affected storage or image-conversion workflows could suffer meaningful availability or data integrity impact.
Executive priority
Treat as a targeted reliability issue for OCFS2 environments. It should be patched through normal kernel maintenance, with higher urgency for shared storage or image-processing systems where corruption could affect operations.
Technical view
OCFS2 could corrupt data when fallocate punched holes beyond inode size, then extended the inode while writeback occurred. Pages beyond the old inode size could be dropped before the new size was applied. The kernel fix zeroes EOF blocks when extending inode size.
Likely exposure
Exposure is most likely on Linux systems using OCFS2 with workloads that punch holes and extend files via fallocate. The source specifically cites qemu-img conversion behavior as an easy corruption trigger. Systems not using OCFS2 are not indicated as exposed by the provided description.
Exploitation context
The CVSS vector is local, low complexity, low privileges, and no user interaction. The source bundle does not indicate active exploitation, and KEV is false. The public description provides a reproducible workload context but not evidence of weaponized exploitation.
Researcher notes
The evidence describes a race-like ordering problem between fallocate, inode size extension, EOF zeroing, and writeback. Public sources identify kernel stable commits but do not provide distro-specific package status or exploitation in the wild.
Mitigation direction
Update affected Linux kernels to versions containing the referenced stable fixes.
Confirm vendor distribution advisories for exact fixed package versions.
Prioritize OCFS2 systems handling virtual disk image conversion or sparse-file workflows.
Avoid relying on unsupported kernel builds for OCFS2 storage workloads.
Validation and detection
Inventory Linux hosts using OCFS2 filesystems.
Check kernel versions against vendor advisories and referenced stable commits.
Review storage workflows using fallocate punch-hole and file-extension behavior.
Look for unexplained file corruption in OCFS2-backed image conversion workloads.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2021-47114 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.