Description
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.
Published: 2026-05-06
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

This vulnerability originates from a logic flaw in the Linux kernel XFS filesystem code that mis‑manages freemap entries when they become zero‑sized. The bug can allow an expansion of the extended attribute array to produce a zero‑size freemap entry with a non‑zero base. Subsequent attribute operations may create another entry with the same base but a non‑zero size, giving the allocation code the illusion of free space where none exists. When a new extended attribute is added, space can be written on top of the existing entries array, corrupting data stored in the file system and causing loss of integrity for affected files.

Affected Systems

All Linux kernel releases that include XFS support are affected when the kernel has not been patched to include the commit that deletes zero‑size freemap entries. This includes most mainstream distributions that ship the upstream kernel version in which the defect existed.

Risk and Exploitability

The defect is a local integrity flaw; an attacker must have write access to a volume formatted with XFS on a system running the vulnerable kernel. There is no publicly available remote exploitation vector. The EPSS score is not available, and the vulnerability is not listed in CISA’s KEV catalog, suggesting a moderate likelihood of exploitation in the wild. Nevertheless, because the defect can silently overwrite data, it should be treated as a high risk to data integrity. Incrementally applying a kernel that includes the fix mitigates the threat.

Generated by OpenCVE AI on May 6, 2026 at 14:52 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Deploy a kernel update that includes the XFS fix commit 2a2b5932… and restart any services that use XFS volumes.
  • If a patch cannot be applied immediately, mount the affected XFS volumes in read‑only mode to prevent further write operations until a fix is available.
  • After updating, run xfs_repair or the filesystem check utility on each volume to detect and repair any corruption that may have already occurred.

Generated by OpenCVE AI on May 6, 2026 at 14:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 06 May 2026 15:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-665

Wed, 06 May 2026 12:15:00 +0000

Type Values Removed Values Added
Description 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.
Title xfs: delete attr leaf freemap entries when empty
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-05-06T11:27:57.727Z

Reserved: 2026-05-01T14:12:55.991Z

Link: CVE-2026-43187

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-05-06T12:16:37.440

Modified: 2026-05-06T13:07:51.607

Link: CVE-2026-43187

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-06T16:30:06Z

Weaknesses