CVE-2024-49958: ocfs2: reserve space for inline xattr before attaching reflink tree
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: reserve space for inline xattr before attaching reflink tree
One of our customers reported a crash and a corrupted ocfs2 filesystem.
The crash was due to the detection of corruption. Upon troubleshooting,
the fsck -fn output showed the below corruption
[EXTENT_LIST_FREE] Extent list in owner 33080590 claims 230 as the next free chain record,
but fsck believes the largest valid value is 227. Clamp the next record value? n
The stat output from the debugfs.ocfs2 showed the following corruption
where the "Next Free Rec:" had overshot the "Count:" in the root metadata
block.
Inode: 33080590 Mode: 0640 Generation: 2619713622 (0x9c25a856)
FS Generation: 904309833 (0x35e6ac49)
CRC32: 00000000 ECC: 0000
Type: Regular Attr: 0x0 Flags: Valid
Dynamic Features: (0x16) HasXattr InlineXattr Refcounted
Extended Attributes Block: 0 Extended Attributes Inline Size: 256
User: 0 (root) Group: 0 (root) Size: 281320357888
Links: 1 Clusters: 141738
ctime: 0x66911b56 0x316edcb8 -- Fri Jul 12 06:02:30.829349048 2024
atime: 0x66911d6b 0x7f7a28d -- Fri Jul 12 06:11:23.133669517 2024
mtime: 0x66911b56 0x12ed75d7 -- Fri Jul 12 06:02:30.317552087 2024
dtime: 0x0 -- Wed Dec 31 17:00:00 1969
Refcount Block: 2777346
Last Extblk: 2886943 Orphan Slot: 0
Sub Alloc Slot: 0 Sub Alloc Bit: 14
Tree Depth: 1 Count: 227 Next Free Rec: 230
## Offset Clusters Block#
0 0 2310 2776351
1 2310 2139 2777375
2 4449 1221 2778399
3 5670 731 2779423
4 6401 566 2780447
....... .... .......
....... .... .......
The issue was in the reflink workfow while reserving space for inline
xattr. The problematic function is ocfs2_reflink_xattr_inline(). By the
time this function is called the reflink tree is already recreated at the
destination inode from the source inode. At this point, this function
reserves space for inline xattrs at the destination inode without even
checking if there is space at the root metadata block. It simply reduces
the l_count from 243 to 227 thereby making space of 256 bytes for inline
xattr whereas the inode already has extents beyond this index (in this
case up to 230), thereby causing corruption.
The fix for this is to reserve space for inline metadata at the destination
inode before the reflink tree gets recreated. The customer has verified the
fix.
Security readout for executives and security teams
Plain-English summary
A flaw in Linux's OCFS2 filesystem can corrupt filesystem metadata and trigger a crash during certain reflink operations involving inline extended attributes. The supplied report describes an actual customer corruption incident. Affected OCFS2 systems could suffer data integrity and availability impacts, but the evidence does not establish malicious exploitation.
Executive priority
Treat this as a high-priority integrity and availability issue wherever OCFS2 is actively used, particularly for critical or shared storage. Patch during the nearest controlled maintenance window and accelerate action if corruption indicators appear. Deprioritize only after confirming OCFS2 is absent or the correction is present.
Technical view
OCFS2 reserved 256 bytes for inline extended attributes after recreating the destination reflink extent tree. This reduced the root metadata capacity from 243 to 227 records even when higher records already existed, leaving an invalid next-free value and causing corruption detection and a crash. The fix reserves space before rebuilding the reflink tree.
Likely exposure
Exposure is limited to systems using affected Linux kernels with OCFS2 and relevant reflink workflows involving inline extended attributes. Systems not using OCFS2 are unlikely to be affected. The supplied CVSS vector describes local, low-privilege access with no user interaction; remote exposure is not established.
Exploitation context
The CVE is not listed as KEV in the supplied bundle, and no source reports active malicious exploitation or a public exploit. A customer experienced a crash and filesystem corruption, demonstrating operational impact rather than confirmed attack activity. The exact reliability and attacker control of the trigger remain unclear.
Researcher notes
The supplied record assigns CVSS 3.1 score 7.8 with local access, low complexity, low privileges, and high confidentiality, integrity, and availability impacts. No CWE is provided. The customer reportedly verified the ordering fix, but the bundle does not establish exploitability, reproducibility across configurations, or precise distribution package status.
Mitigation direction
Apply a vendor-supported kernel update containing the applicable stable backport.
Prioritize actively mounted OCFS2 filesystems and systems performing reflink operations.
Follow Linux or distribution guidance when selecting the corrected kernel package.
Protect critical data with verified backups before filesystem maintenance or recovery.
Validation and detection
Inventory hosts that mount, manage, or store OCFS2 filesystems.
Compare installed kernels with vendor advisories and applicable stable fix commits.
Review storage and kernel logs for OCFS2 corruption detection or related crashes.
Assess suspected volumes using supported OCFS2 consistency tooling and established recovery procedures.
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-2024-49958 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.