CVE-2026-31666

Source
https://cve.org/CVERecord?id=CVE-2026-31666
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31666.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2026-31666
Downstream
Related
Published
2026-04-24T14:45:15.271Z
Modified
2026-06-02T18:29:18.014111925Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()
Details

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

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

After commit 1618aa3c2e01 ("btrfs: simplify return variables in lookupextentdataref()"), the err and ret variables were merged into a single ret variable. However, when btrfsnext_leaf() 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.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31666.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1618aa3c2e0163f5ac34d514ae89474521910536
Fixed
4125a194db4a6cf91f619f38788272651cb97dce
Fixed
450e6a685d0cad95b15f8af152057bd0bf79f50b
Fixed
ab1e022379c3c811aa72da8eb0c7507859a1d0f5
Fixed
316fb1b3169efb081d2db910cbbfef445afa03b9

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31666.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.10.0
Fixed
6.12.82
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.18.23
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
6.19.13

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-31666.json"