Skip to main content

CVE-2024-49958: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-49958cvecve-2024-49958
Published: Mon Oct 21 2024 (10/21/2024, 18:02:11 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

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.

AI-Powered Analysis

AILast updated: 06/27/2025, 21:41:42 UTC

Technical Analysis

CVE-2024-49958 is a vulnerability in the Linux kernel's OCFS2 (Oracle Cluster File System version 2) filesystem implementation. The flaw arises in the reflink workflow during the reservation of space for inline extended attributes (xattr). Specifically, the function ocfs2_reflink_xattr_inline() attempts to reserve space for inline xattrs at the destination inode after the reflink tree has already been recreated from the source inode. This reservation reduces the l_count (extent count) from 243 to 227 to allocate 256 bytes for inline xattrs without verifying if the root metadata block has sufficient space. However, the inode already contains extents beyond this reduced index (up to 230 in the reported case), leading to metadata corruption. This corruption manifests as filesystem inconsistencies detected by fsck, such as extent list records claiming invalid next free chain records, and can cause system crashes and data integrity issues. The root cause is improper ordering of operations—reserving space for inline metadata should occur before recreating the reflink tree to avoid overlapping extents. The vulnerability was reported by a customer who experienced a crash and corrupted OCFS2 filesystem. The fix involves adjusting the reservation timing to occur prior to reflink tree recreation, preventing the corruption. This vulnerability affects specific Linux kernel versions identified by commit hashes and was publicly disclosed on October 21, 2024. No known exploits are currently in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems using the OCFS2 filesystem, which is commonly deployed in clustered environments and enterprise storage solutions. Organizations relying on Linux servers with OCFS2 for critical data storage or cluster file sharing could experience filesystem corruption leading to data loss, system crashes, and downtime. This can disrupt business operations, especially in sectors like finance, manufacturing, telecommunications, and research institutions that utilize clustered Linux environments. The corruption can also complicate recovery efforts, potentially requiring manual fsck interventions or data restoration from backups. While exploitation does not appear to be remotely triggered, the vulnerability could be triggered by local users or processes performing reflink operations with inline xattrs, making it a concern for multi-user or multi-tenant environments. The integrity and availability of data are the primary impacted security properties, with confidentiality less directly affected. Given the kernel-level nature of the flaw, it could also affect containerized or virtualized workloads running on vulnerable hosts.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernels to versions containing the fix for CVE-2024-49958 as soon as patches become available from their Linux distribution vendors. Since the vulnerability relates to OCFS2, organizations should audit their infrastructure to identify systems using this filesystem and assess their exposure. For environments where immediate patching is not feasible, administrators should limit or monitor operations involving reflink and inline xattrs on OCFS2 filesystems, especially those initiated by untrusted users or automated processes. Implementing strict access controls and filesystem integrity monitoring can help detect early signs of corruption. Regular backups and tested recovery procedures are essential to mitigate potential data loss. Additionally, organizations should consider isolating critical OCFS2 storage nodes to reduce the risk of cascading failures. Collaboration with Linux distribution maintainers and monitoring security advisories for updated patches and mitigation guidance is recommended.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-10-21T12:17:06.048Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9820c4522896dcbdceb0

Added to database: 5/21/2025, 9:08:48 AM

Last enriched: 6/27/2025, 9:41:42 PM

Last updated: 8/12/2025, 8:10:05 AM

Views: 13

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats