CVE-2026-31666: btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()

Published Apr 24, 2026
·
Updated

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

btrfs: fix incorrect return value after changing leaf in lookupextentdataref()

After commit 1618aa3c2e01 ("btrfs: simplify return variables in lookupextentdataref()"), the err and ret variables were merged into a single ret variable. However, when btrfsnextleaf() returns 0 (success), ret is overwritten from -ENOENT to 0. If the first key in the next leaf does not match (different objectid or type), the function returns 0 instead of -ENOENT, making the caller believe the lookup succeeded when it did not. This can lead to operations on the wrong extent tree item, potentially causing extent tree corruption.

Fix this by returning -ENOENT directly when the key does not match, instead of relying on the ret variable.

Affected Software

12 affected components
Linux Linux kernel
Linux Linux kernel>=6.10.1<6.12.82
Linux Linux kernel>=6.13<6.18.23
Linux Linux kernel>=6.19<6.19.13
Linux Linux kernel=6.10
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
Linux Linux kernel=7.0-rc6
Linux Linux kernel=7.0-rc7

Event History

Apr 24, 2026
CVE Published
via MITRE·02:45 PM
Data Sourced
via MITRE·02:45 PM
DescriptionSeverity
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-31666?

CVE-2026-31666 has been classified as a medium severity vulnerability.

2

How do I fix CVE-2026-31666?

To fix CVE-2026-31666, apply the relevant patches or updates provided for your version of the Linux kernel.

3

What impact does CVE-2026-31666 have on Linux kernel systems?

CVE-2026-31666 can lead to incorrect return values when changing leaf nodes, potentially affecting data integrity.

4

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

CVE-2026-31666 affects various versions of the Linux kernel that utilize the btrfs filesystem.

5

Is CVE-2026-31666 actively exploited in the wild?

As of now, there is no known active exploitation reported for CVE-2026-31666.

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