KernelScan.io

HIGH

xfs Freemap Corruption

CVE-2026-43187

CVSS 8.8 / 10.0 NVD

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

KernelScan AI4.6MEDIUM

01

In the Linux kernel, the following vulnerability has been resolved: xfs: delete attr leaf freemap entries when empty Back in commit 2a2b5932db6758 ("xfs: fix attr leaf header freemap.size underflow"), Brian Foster observed that it's possible for a small freemap at the end of the end of the xattr entries array to experience a size underflow when subtracting the space consumed by an expansion of the entries array. There are only three freemap entries, which means that it is not a complete index of all free space in the leaf block. This code can leave behind a zero-length freemap entry with a nonzero base. Subsequent setxattr operations can increase the base up to the point that it overlaps with another freemap entry. This isn't in and of itself a problem because the code in _leaf_add that finds free space ignores any freemap entry with zero size. However, there's another bug in the freemap update code in _leaf_add, which is that it fails to update a freemap entry that begins midway through the xattr entry that was just appended to the array. That can result in the freemap containing two entries with the same base but different sizes (0 for the "pushed-up" entry, nonzero for the entry that's actually tracking free space). A subsequent _leaf_add can then allocate xattr namevalue entries on top of the entries array, leading to data loss. But fixing that is for later. For now, eliminate the possibility of confusion by zeroing out the base of any freemap entry that has zero size. Because the freemap is not intended to be a complete index of free space, a subsequent failure to find any free space for a new xattr will trigger block compaction, which regenerates the freemap. It looks like this bug has been in the codebase for quite a long time.

02

Engine v0.2.0

Risk summary

XFS filesystems can experience data corruption when extended attributes are modified through specific operation sequences. The freemap management code can create overlapping entries that cause new xattr data to overwrite existing entries, leading to data loss.

Affectedfs/xfs/libxfs/xfs_attr_leaf.c (XFS filesystem)

Vulnerability analysis

The root cause is improper freemap entry management in XFS attribute leaf blocks. Zero-length freemap entries with nonzero base addresses can be left behind, which when combined with another freemap update bug, creates overlapping freemap entries. This allows subsequent xattr operations to allocate space on top of existing entries array data, corrupting filesystem metadata and causing data loss. The fix zeros out the base address of any zero-length freemap entries to prevent the overlapping condition.

03

BranchFixed inPatch commit
5.105.10.252f3c0d1fc1ead
5.155.15.202aa9083d97e21
6.16.1.165a631899025d4
6.126.12.75e1b8c6452ee9
6.186.18.16f31a8334e1c5
6.196.19.6479b05fc3ee2
6.66.6.128ffaf5c99d0f8
mainline7.06f13c1d2a627