ocfs2: find the xattr entry again after defragmenting a bucket

Summary

CVECVE-2026-99696
StatePUBLISHED
AssignerLinux
Source PriorityCVE Program / NVD first with legacy fallback
Published2026-11-20 06:18:05 UTC
Updated2026-11-20 06:18:05 UTC
DescriptionIn the Linux kernel, the following vulnerability has been resolved: ocfs2: find the xattr entry again after defragmenting a bucket ocfs2_xattr_set_entry_bucket() hands loc.xl_entry to ocfs2_xa_set() twice: once for the bucket as it stands, and, if that reports -ENOSPC, once more after ocfs2_defrag_xattr_bucket() has packed the name/value pairs down. Defragmenting ends by sorting the entry array on xe_name_hash. Buckets are kept sorted, so the sort only permutes entries that share a hash, but lib/sort.c is an unstable heapsort and it does permute them. loc.xl_entry is an address inside xh_entries[], so afterwards it denotes whichever entry landed in that slot rather than the one the search found. The second ocfs2_xa_set() then works on the wrong entry. Nothing on that path compares the entry's name with xi->xi_name, so what happens depends on how the two entries compare in size: ocfs2_xa_reuse_entry() trips its BUG_ON() when the padded name sizes differ, and otherwise the new value is written into the neighbouring attribute's value slot while the attribute being set is left untouched. setxattr() reports success either way. Remember the entry's hash before defragmenting and look the entry up again afterwards, the way ocfs2_xattr_bucket_find() does. An entry that cannot be found again means the bucket no longer holds what the search found, so fail with -EFSCORRUPTED rather than writing through the stale pointer.

Vendor Declared Affected Products

SourceVendorProductVersionPlatforms
CNA Linux Linux affected 012255961c9ecfe22b7a1df47ac26ab37818cb1e b839d9913b56f0d769dced34cdfbe02a009b3bf1 git Not specified
CNA Linux Linux affected 012255961c9ecfe22b7a1df47ac26ab37818cb1e 89ef9cb4da160b5572e0e5b9cf930335117d561b git Not specified
CNA Linux Linux affected 012255961c9ecfe22b7a1df47ac26ab37818cb1e 8c107f10fe63fdec081c2ae471fc90b4d3376db6 git Not specified
CNA Linux Linux affected 012255961c9ecfe22b7a1df47ac26ab37818cb1e 9a40c050f58344615a0604701b5d299519833163 git Not specified
CNA Linux Linux affected 2.6.28 Not specified
CNA Linux Linux unaffected 2.6.28 semver Not specified
CNA Linux Linux unaffected 6.12.118 6.12.* semver Not specified
CNA Linux Linux unaffected 6.18.64 6.18.* semver Not specified
CNA Linux Linux unaffected 7.3.5 7.3.* semver Not specified
CNA Linux Linux unaffected 7.4-rc2 * original_commit_for_fix Not specified

References

ReferenceSourceLinkTags
git.kernel.org/stable/c/9a40c050f58344615a0604701b5d299519833163 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/89ef9cb4da160b5572e0e5b9cf930335117d561b 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/b839d9913b56f0d769dced34cdfbe02a009b3bf1 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
git.kernel.org/stable/c/8c107f10fe63fdec081c2ae471fc90b4d3376db6 416baaa9-dc9f-4396-8d5f-8c081fb06d67 git.kernel.org
CVE Program record CVE.ORG www.cve.org canonical
NVD vulnerability detail NVD nvd.nist.gov canonical, analysis

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report