# CVE-2026-43158: xfs: fix freemap adjustments when adding xattrs to leaf blocks

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 8.8
- **CVSS:** 8.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, login needed
- **EPSS:** 0.68% (percentile 47, 2026-11-26)
- **CWE:** CWE-787, CWE-664
- **Published:** 2026-05-06T11:27:37.848Z
- **Modified:** 2026-11-11T21:10:00.200Z

## Who should check

- Anyone running Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d08976725355b9d54d8332fce223fa281cc304a5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 6a8737afbccc340e718e0b22577312826390be8b; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< a396b3d73d51355e50acdb403ba9c4cae4c1174e; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 38613c01f69e1e77e6b8acab1e8ac665d01c2f15; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< ef42a8766ff3fdf51cf72fb36d0859c09d134478; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 43f3b18679615a93bd848afde3602ba160637a46; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 24ce71852f2cee6581e2cbebc15489ed52bf63b7; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 3eefc0c2b78444b64feeb3783c017d6adc3cd3ce
- Anyone running Linux 2.6.12

## Description

In the Linux kernel, the following vulnerability has been resolved:

xfs: fix freemap adjustments when adding xattrs to leaf blocks

xfs/592 and xfs/794 both trip this assertion in the leaf block freemap
adjustment code after ~20 minutes of running on my test VMs:

 ASSERT(ichdr-\>firstused \>= ichdr-\>count \* sizeof(xfs\_attr\_leaf\_entry\_t)
					+ xfs\_attr3\_leaf\_hdr\_size(leaf));

Upon enabling quite a lot more debugging code, I narrowed this down to
fsstress trying to set a local extended attribute with namelen=3 and
valuelen=71.  This results in an entry size of 80 bytes.

At the start of xfs\_attr3\_leaf\_add\_work, the freemap looks like this:

i 0 base 448 size 0 rhs 448 count 46
i 1 base 388 size 132 rhs 448 count 46
i 2 base 2120 size 4 rhs 448 count 46
firstused = 520

where "rhs" is the first byte past the end of the leaf entry array.
This is inconsistent -- the entries array ends at byte 448, but
freemap\[1\] says there's free space starting at byte 388!

By the end of the function, the freemap is in worse shape:

i 0 base 456 size 0 rhs 456 count 47
i 1 base 388 size 52 rhs 456 count 47
i 2 base 2120 size 4 rhs 456 count 47
firstused = 440

Important note: 388 is not aligned with the entries array element size
of 8 bytes.

Based on the incorrect freemap, the name area starts at byte 440, which
is below the end of the entries array!  That's why the assertion
triggers and the filesystem shuts down.

How did we end up here?  First, recall from the previous patch that the
freemap array in an xattr leaf block is not intended to be a
comprehensive map of all free space in the leaf block.  In other words,
it's perfectly legal to have a leaf block with:

 \* 376 bytes in use by the entries array
 \* freemap\[0\] has \[base = 376, size = 8\]
 \* freemap\[1\] has \[base = 388, size = 1500\]
 \* the space between 376 and 388 is free, but the freemap stopped
   tracking that some time ago

If we add one xattr, the entries array grows to 384 bytes, and
freemap\[0\] becomes \[base = 384, size = 0\].  So far, so good.  But if we
add a second xattr, the entries array grows to 392 bytes, and freemap\[0\]
gets pushed up to \[base = 392, size = 0\].  This is bad, because
freemap\[1\] hasn't been updated, and now the entries array and the free
space claim the same space.

The fix here is to adjust all freemap entries so that none of them
collide with the entries array.  Note that this fix relies on commit
2a2b5932db6758 ("xfs: fix attr leaf header freemap.size underflow") and
the previous patch that resets zero length freemap entries to have
base = 0.

## Affected and fixed versions

- Linux: \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d08976725355b9d54d8332fce223fa281cc304a5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 6a8737afbccc340e718e0b22577312826390be8b; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< a396b3d73d51355e50acdb403ba9c4cae4c1174e; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 38613c01f69e1e77e6b8acab1e8ac665d01c2f15; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< ef42a8766ff3fdf51cf72fb36d0859c09d134478; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 43f3b18679615a93bd848afde3602ba160637a46; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 24ce71852f2cee6581e2cbebc15489ed52bf63b7; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 3eefc0c2b78444b64feeb3783c017d6adc3cd3ce (cvelist)
- Linux: 2.6.12 (cvelist)

## Mitigation

- Upgrade Linux to 3eefc0c2b78444b64feeb3783c017d6adc3cd3ce or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-43158. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-43158.md
Affected: Linux >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < d08976725355b9d54d8332fce223fa281cc304a5; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 6a8737afbccc340e718e0b22577312826390be8b; >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < a396b3d73d51355e50acdb403ba9c4cae4c1174e; >= 1da177e4c3f41524e886b7f…
Fixed in: Linux 6a8737afbccc340e718e0b22577312826390be8b, Linux 38613c01f69e1e77e6b8acab1e8ac665d01c2f15, Linux 43f3b18679615a93bd848afde3602ba160637a46, Linux 24ce71852f2cee6581e2cbebc15489ed52bf63b7, Linux 3eefc0c2b78444b64feeb3783c017d6adc3cd3ce

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-43158 being exploited?

There is no confirmed exploitation: CVE-2026-43158 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.68% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-43158?

High: CVSS 8.8 (v3.1, scored by CNA). Remote, login needed.

### Which versions are affected by CVE-2026-43158?

Linux \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< d08976725355b9d54d8332fce223fa281cc304a5; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 6a8737afbccc340e718e0b22577312826390be8b; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< a396b3d73d51355e50acdb403ba9c4cae4c1174e; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 38613c01f69e1e77e6b8acab1e8ac665d01c2f15; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< ef42a8766ff3fdf51cf72fb36d0859c09d134478; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 43f3b18679615a93bd848afde3602ba160637a46; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 24ce71852f2cee6581e2cbebc15489ed52bf63b7; \>= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, \< 3eefc0c2b78444b64feeb3783c017d6adc3cd3ce; Linux 2.6.12.

### Is there a fix for CVE-2026-43158?

Yes. Fixed in Linux 6a8737afbccc340e718e0b22577312826390be8b, Linux 38613c01f69e1e77e6b8acab1e8ac665d01c2f15, Linux 43f3b18679615a93bd848afde3602ba160637a46, Linux 24ce71852f2cee6581e2cbebc15489ed52bf63b7, Linux 3eefc0c2b78444b64feeb3783c017d6adc3cd3ce. Upgrade Linux to 3eefc0c2b78444b64feeb3783c017d6adc3cd3ce or later.

### How do I check if I'm affected by CVE-2026-43158?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/d08976725355b9d54d8332fce223fa281cc304a5>
- patch: <https://git.kernel.org/stable/c/6a8737afbccc340e718e0b22577312826390be8b>
- patch: <https://git.kernel.org/stable/c/a396b3d73d51355e50acdb403ba9c4cae4c1174e>
- patch: <https://git.kernel.org/stable/c/38613c01f69e1e77e6b8acab1e8ac665d01c2f15>
- patch: <https://git.kernel.org/stable/c/ef42a8766ff3fdf51cf72fb36d0859c09d134478>
- patch: <https://git.kernel.org/stable/c/43f3b18679615a93bd848afde3602ba160637a46>
- patch: <https://git.kernel.org/stable/c/24ce71852f2cee6581e2cbebc15489ed52bf63b7>
- patch: <https://git.kernel.org/stable/c/3eefc0c2b78444b64feeb3783c017d6adc3cd3ce>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-43158>

HTML: <https://flawdb.com/CVE-2026-43158> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-43158>
