AZL-115549: CVE-2026-99696 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
ocfs2: find the xattr entry again after defragmenting a bucket
ocfs2xattrsetentrybucket() hands loc.xlentry to ocfs2xaset() twice: once for the bucket as it stands, and, if that reports -ENOSPC, once more after ocfs2defragxattrbucket() has packed the name/value pairs down.
Defragmenting ends by sorting the entry array on xenamehash. 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.xlentry is an address inside xhentries[], so afterwards it denotes whichever entry landed in that slot rather than the one the search found.
The second ocfs2xaset() then works on the wrong entry. Nothing on that path compares the entry's name with xi->xiname, so what happens depends on how the two entries compare in size: ocfs2xareuseentry() trips its BUGON() 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 ocfs2xattrbucketfind() 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.