# CVE-2026-43118: btrfs: fix zero size inode with non-zero size after log replay

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.16% (percentile 3, 2026-11-28)
- **Published:** 2026-05-06T07:40:42.598Z
- **Modified:** 2026-11-11T21:10:00.200Z

## Who should check

- Anyone running Linux \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 126999610eddeb1de3b47680585f4bc9531dc7f4; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< c939bfa67d221f75351a5bf2fc912e8125547b7e; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 91990732ec4ce5c09361d498c6d621f5a76ee1f2; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< fddb157536e67a055597f00a8b4922d5f5ed0826; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 03e966b63df5b06790310c1faaf3e0cb43adea8b; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 5254d4181add9dfaa5e3519edd71cc8f752b2f85
- Anyone running Linux 2.6.30

## Description

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

btrfs: fix zero size inode with non-zero size after log replay

When logging that an inode exists, as part of logging a new name or
logging new dir entries for a directory, we always set the generation of
the logged inode item to 0. This is to signal during log replay (in
overwrite\_item()), that we should not set the i\_size since we only logged
that an inode exists, so the i\_size of the inode in the subvolume tree
must be preserved (as when we log new names or that an inode exists, we
don't log extents).

This works fine except when we have already logged an inode in full mode
or it's the first time we are logging an inode created in a past
transaction, that inode has a new i\_size of 0 and then we log a new name
for the inode (due to a new hardlink or a rename), in which case we log
an i\_size of 0 for the inode and a generation of 0, which causes the log
replay code to not update the inode's i\_size to 0 (in overwrite\_item()).

An example scenario:

  mkdir /mnt/dir
  xfs\_io -f -c "pwrite 0 64K" /mnt/dir/foo

  sync

  xfs\_io -c "truncate 0" -c "fsync" /mnt/dir/foo

  ln /mnt/dir/foo /mnt/dir/bar

  xfs\_io -c "fsync" /mnt/dir

  \<power fail\>

After log replay the file remains with a size of 64K. This is because when
we first log the inode, when we fsync file foo, we log its current i\_size
of 0, and then when we create a hard link we log again the inode in exists
mode (LOG\_INODE\_EXISTS) but we set a generation of 0 for the inode item we
add to the log tree, so during log replay overwrite\_item() sees that the
generation is 0 and i\_size is 0 so we skip updating the inode's i\_size
from 64K to 0.

Fix this by making sure at fill\_inode\_item() we always log the real
generation of the inode if it was logged in the current transaction with
the i\_size we logged before. Also if an inode created in a previous
transaction is logged in exists mode only, make sure we log the i\_size
stored in the inode item located from the commit root, so that if we log
multiple times that the inode exists we get the correct i\_size.

A test case for fstests will follow soon.

## Affected and fixed versions

- Linux: \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 126999610eddeb1de3b47680585f4bc9531dc7f4; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< c939bfa67d221f75351a5bf2fc912e8125547b7e; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 91990732ec4ce5c09361d498c6d621f5a76ee1f2; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< fddb157536e67a055597f00a8b4922d5f5ed0826; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 03e966b63df5b06790310c1faaf3e0cb43adea8b; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 5254d4181add9dfaa5e3519edd71cc8f752b2f85 (cvelist)
- Linux: 2.6.30 (cvelist)

## Mitigation

- Upgrade Linux to 5254d4181add9dfaa5e3519edd71cc8f752b2f85 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-43118. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-43118.md
Affected: Linux >= 12fcfd22fe5bf4fe74710232098bc101af497995, < 126999610eddeb1de3b47680585f4bc9531dc7f4; >= 12fcfd22fe5bf4fe74710232098bc101af497995, < c939bfa67d221f75351a5bf2fc912e8125547b7e; >= 12fcfd22fe5bf4fe74710232098bc101af497995, < 91990732ec4ce5c09361d498c6d621f5a76ee1f2; >= 12fcfd22fe5bf4fe7471023…
Fixed in: Linux 126999610eddeb1de3b47680585f4bc9531dc7f4, Linux 91990732ec4ce5c09361d498c6d621f5a76ee1f2, Linux 03e966b63df5b06790310c1faaf3e0cb43adea8b, Linux 5254d4181add9dfaa5e3519edd71cc8f752b2f85

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-43118 being exploited?

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 126999610eddeb1de3b47680585f4bc9531dc7f4; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< c939bfa67d221f75351a5bf2fc912e8125547b7e; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 91990732ec4ce5c09361d498c6d621f5a76ee1f2; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< fddb157536e67a055597f00a8b4922d5f5ed0826; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 03e966b63df5b06790310c1faaf3e0cb43adea8b; \>= 12fcfd22fe5bf4fe74710232098bc101af497995, \< 5254d4181add9dfaa5e3519edd71cc8f752b2f85; Linux 2.6.30.

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

Yes. Fixed in Linux 126999610eddeb1de3b47680585f4bc9531dc7f4, Linux 91990732ec4ce5c09361d498c6d621f5a76ee1f2, Linux 03e966b63df5b06790310c1faaf3e0cb43adea8b, Linux 5254d4181add9dfaa5e3519edd71cc8f752b2f85. Upgrade Linux to 5254d4181add9dfaa5e3519edd71cc8f752b2f85 or later.

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

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/fddb157536e67a055597f00a8b4922d5f5ed0826>
- patch: <https://git.kernel.org/stable/c/03e966b63df5b06790310c1faaf3e0cb43adea8b>
- patch: <https://git.kernel.org/stable/c/5254d4181add9dfaa5e3519edd71cc8f752b2f85>
- other: <https://git.kernel.org/stable/c/126999610eddeb1de3b47680585f4bc9531dc7f4>
- other: <https://git.kernel.org/stable/c/c939bfa67d221f75351a5bf2fc912e8125547b7e>
- other: <https://git.kernel.org/stable/c/91990732ec4ce5c09361d498c6d621f5a76ee1f2>

## 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-43118>

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