CVE-2026-99695: ocfs2: find the xattr entry again after converting a block to a bucket
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: find the xattr entry again after converting a block to a bucket
ocfs2xattrcreateindexblock() 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. ocfs2xattrupdatexattrsearch() 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->notfound clear. The block gave up because ocfs2xablockcanreuse() wants an exact namevalue size match, while ocfs2xabucketcanreuse() 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 ocfs2xareuseentry()'s BUGON, and a shorter one is refused by the bucket as well, so ocfs2xaprepareentry() wipes the entry and writes the new name over it, leaving xenamehash 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 ocfs2xattrset(), 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->setabort, which is what stops the conversion. Scan every entry rather than narrowing on the hash the way ocfs2findxeinbucket() 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.5-1
Event History
Frequently Asked Questions
Who can trigger the incorrect update?
An actor needs the ability to set extended attributes on an OCFS2 filesystem and must cause an existing attribute value to outgrow the non-indexed xattr block. The problematic path occurs when that block is converted into an indexed bucket.
What is the impact on stored attributes?
The update can be applied to an unrelated xattr entry after entries are reordered during conversion. In some cases, setxattr reports success even though the requested attribute retains its old value while another attribute's value is replaced.
Can applications rely on a successful setxattr result?
No. Under the affected conversion conditions, setxattr can succeed while modifying a different attribute instead of the requested one. Applications handling sensitive xattrs should verify the resulting attribute name and value after writes until the applicable fix is deployed.
What fix information is available?
The issue is described as resolved in the Linux kernel, with stable-tree fix references for commits 49820bda28134ab0f6748e66cb104c9adcc2e116, 1ca9787e733a29aea926f8956dffc41bf553c5ca, and 2bd2ca4f70570f08992ba38dbf2570f8def4288e. The provided data does not identify the kernel release versions containing those fixes.