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

Published May 6, 2026
·
Updated

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 overwriteitem()), that we should not set the isize since we only logged that an inode exists, so the isize 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 isize 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 isize of 0 for the inode and a generation of 0, which causes the log replay code to not update the inode's isize to 0 (in overwriteitem()).

An example scenario:

mkdir /mnt/dir xfsio -f -c "pwrite 0 64K" /mnt/dir/foo

sync

xfsio -c "truncate 0" -c "fsync" /mnt/dir/foo

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

xfsio -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 isize of 0, and then when we create a hard link we log again the inode in exists mode (LOGINODEEXISTS) but we set a generation of 0 for the inode item we add to the log tree, so during log replay overwriteitem() sees that the generation is 0 and isize is 0 so we skip updating the inode's isize from 64K to 0.

Fix this by making sure at fillinodeitem() we always log the real generation of the inode if it was logged in the current transaction with the isize we logged before. Also if an inode created in a previous transaction is logged in exists mode only, make sure we log the isize 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 isize.

A test case for fstests will follow soon.

Affected Software

8 affected components
Linux btrfs (Linux kernel)
Linux Linux kernel>=2.6.30<6.18.24
Linux Linux kernel>=6.19<6.19.14
Linux Linux kernel=7.0-rc1
Linux Linux kernel=7.0-rc2
Linux Linux kernel=7.0-rc3
Linux Linux kernel=7.0-rc4
Linux Linux kernel=7.0-rc5

Event History

May 6, 2026
CVE Published
via MITRE·07:40 AM
Data Sourced
via MITRE·07:40 AM
Description
Data Sourced
via NVD·10:16 AM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-43118?

CVE-2026-43118 has been rated as a low severity vulnerability affecting btrfs in the Linux kernel.

2

How do I fix CVE-2026-43118?

To resolve CVE-2026-43118, you should update to the latest version of the Linux kernel that includes the fix.

3

What does CVE-2026-43118 affect?

CVE-2026-43118 affects the btrfs filesystem implementation in the Linux kernel.

4

Is CVE-2026-43118 exploitable?

CVE-2026-43118 is not expected to be exploitable in practical scenarios but may lead to filesystem anomalies.

5

Which versions of the Linux kernel are affected by CVE-2026-43118?

Versions of the Linux kernel from 2.6.30 to 6.19 and 7.0-rc1 to 7.0-rc5 are affected by CVE-2026-43118.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203