CVE-2026-99695 in Linuxinfo

Summary

by MITRE • 11/20/2026

In the Linux kernel, the following vulnerability has been resolved:

ocfs2: find the xattr entry again after converting a block to a bucket

ocfs2_xattr_create_index_block() turns a non-indexed xattr block into a tree by copying it into a bucket, and the copy sorts the entries: a block holds them in insertion order, a bucket by name hash. ocfs2_xattr_update_xattr_search() nevertheless relocates the caller's search by the index the entry had in the block, so unless the two orders agreed it points at an unrelated entry, and nothing between there and the write compares that entry's name with the one being set.

Setting an xattr whose new value no longer fits the block arrives here with xs->not_found clear. The block gave up because ocfs2_xa_block_can_reuse() wants an exact namevalue size match, while ocfs2_xa_bucket_can_reuse() only wants an entry at least as large as the new one, so the bucket accepts a pair the block rejected and the update lands on whichever entry the sort left at that index. Equal padded name lengths get that other attribute's value replaced in place and its name left alone, so setxattr returns success while the attribute asked for keeps its old value. A longer one trips ocfs2_xa_reuse_entry()'s BUG_ON, and a shorter one is refused by the bucket as well, so ocfs2_xa_prepare_entry() wipes the entry and writes the new name over it, leaving xe_name_hash describing a name that is no longer there.

Find the entry again by the name being set, matching the type as well. The copy carries every entry and every name over unchanged, and (type, name) pairs are unique within a block, so the match is exact. The type matters because the handlers strip their prefix before calling ocfs2_xattr_set(), so user.foo and trusted.foo share a stored name, a stored length and a hash, and both can sit in the same block.

The name has to come from xi rather than from xs->here: a failed set can remove the entry xs->here names, and only the "growing" caller sets ctxt->set_abort, which is what stops the conversion. Scan every entry rather than narrowing on the hash the way ocfs2_find_xe_in_bucket() does, since an existing entry keeps the hash it was stored under, which a kernel that sign-extended the name bytes made different from the one computed now. An empty result means the entry did not survive the failed set and this has become an insert; leaving xs->here alone would keep it pointing into the block, which is rewritten as a tree root before the caller reads it again.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/21/2026

The vulnerability in question resides within the Oracle Cluster File System version 2 (OCFS2) implementation of the Linux kernel, specifically affecting the handling of extended attributes during structural conversions from linear blocks to hash-indexed buckets. Extended attributes are metadata key-value pairs associated with files and directories, allowing for storage of information beyond standard file system fields such as permissions or timestamps. The core technical flaw occurs in the function ocfs2_xattr_create_index_block(), which is responsible for converting a non-indexed extended attribute block into an indexed tree structure by copying entries into a bucket format that sorts them by name hash rather than insertion order. This reordering process creates a discrepancy between the physical location of attributes and their logical indexing, leading to potential data integrity issues if not handled correctly during subsequent updates.

The operational impact stems from how ocfs2_xattr_update_xattr_search() manages search pointers after this conversion. The function incorrectly relocates the caller's search pointer based on the index position an entry held in the original block rather than its new sorted position within the bucket. Consequently, unless the insertion order coincidentally matches the hash-based sort order, the search pointer targets an unrelated or incorrect attribute entry. Crucially, there is no validation step between this misaligned pointer and the actual write operation to verify that the targeted entry's name matches the one intended for modification. This lack of verification allows operations to proceed against the wrong data structures without immediate detection by the file system logic.

The severity of this vulnerability manifests differently depending on the size relationship between the old and new attribute values. When setting an extended attribute where the new value does not fit in the original block, the system attempts to reuse space within a newly created bucket. The block rejection criteria require an exact name-value size match, whereas the bucket only requires an entry that is at least as large as the new one. This discrepancy allows a mismatched pair to be accepted by the bucket logic while being rejected by the block logic. In cases where attribute names have equal padded lengths but differ in actual content, this flaw results in the replacement of another attribute's value with the new data, while its original name remains unchanged. The setxattr system call returns success despite the fact that the requested attribute retains its old value and a different attribute has been silently corrupted.

In scenarios involving longer values, the mismatch triggers an internal kernel assertion failure via BUG_ON in ocfs2_xa_reuse_entry(), potentially causing a local denial of service through kernel panic or crash. Conversely, when shorter values are involved, the bucket logic refuses the operation due to size constraints, leading ocfs2_xa_prepare_entry() to wipe the entry and overwrite it with new data. This leaves the xe_name_hash field describing a name that no longer exists in the structure, creating an inconsistent state within the file system metadata. These inconsistencies can lead to further corruption during subsequent access patterns or filesystem checks, potentially compromising the reliability of stored data on OCFS2 volumes.

The resolution involves ensuring that after converting a block to a bucket, the system explicitly searches for the correct extended attribute entry by matching both its name and type. Since (type, name) pairs are unique within an ocfs2 block, this exact match guarantees identification of the intended target. The fix emphasizes using the original context information rather than potentially stale pointers from previous failed operations to locate entries. It also mandates scanning all entries in the bucket rather than relying solely on hash matching, addressing edge cases where kernel sign-extension differences might cause hash mismatches between old and new computations. This comprehensive search ensures that even if an entry was removed during a prior failed set operation, the system correctly identifies whether it needs to be reinserted or updated.

From a security taxonomy perspective, this vulnerability aligns with CWE-823: Use of Out-of-range Pointer Offset, as the misaligned pointer leads to accessing incorrect memory structures within the file system metadata. It also relates closely to CWE-697: Incorrect Comparison, due to the failure to verify that the targeted entry matches the intended attribute name before performing write operations. In terms of MITRE ATT&CK techniques, this flaw could be leveraged in the context of T1564: Hidden Files and Directories or more broadly under data manipulation tactics where an attacker with local access might attempt to corrupt file metadata to evade detection or disrupt service availability. The vulnerability highlights the critical importance of rigorous state management during structural transformations within kernel-level storage subsystems, ensuring that logical identifiers are always reconciled with physical locations after reordering operations.

Mitigation strategies primarily involve applying the upstream Linux kernel patches that address this specific logic error in OCFS2 extended attribute handling. System administrators should ensure their kernels are updated to versions containing these fixes. For environments where immediate patching is not feasible, monitoring for unusual file system errors or unexpected behavior during extended attribute modifications can serve as a detection mechanism. Additionally, regular integrity checks using tools like fsck.ocfs2 can help identify and repair any metadata inconsistencies that may have resulted from exploitation of this flaw prior to remediation. The fix ensures robustness by validating entry existence and correctness post-conversion, thereby preventing silent data corruption and maintaining the atomicity and consistency guarantees expected of enterprise-grade cluster file systems.

Responsible

Linux

Reservation

09/25/2026

Disclosure

11/20/2026

Moderation

accepted

CPE

ready

EPSS

0.00168

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!