{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-31666","id":"CVE-2026-31666","title":"btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()\n\nAfter commit 1618aa3c2e01 (\"btrfs: simplify return variables in\nlookup_extent_data_ref()\"), the err and ret variables were merged into\na single ret variable. However, when btrfs_next_leaf() returns 0\n(success), ret is overwritten from -ENOENT to 0.","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()\n\nAfter commit 1618aa3c2e01 (\"btrfs: simplify return variables in\nlookup_extent_data_ref()\"), the err and ret variables were merged into\na single ret variable. However, when btrfs_next_leaf() returns 0\n(success), ret is overwritten from -ENOENT to 0. If the first key in\nthe next leaf does not match (different objectid or type), the function\nreturns 0 instead of -ENOENT, making the caller believe the lookup\nsucceeded when it did not. This can lead to operations on the wrong\nextent tree item, potentially causing extent tree corruption.\n\nFix this by returning -ENOENT directly when the key does not match,\ninstead of relying on the ret variable.","published":"2026-04-24T14:45:15.271Z","updated":"2026-11-13T02:31:02.121357197Z","reserved":"2026-03-09T15:48:24.129Z","status":"Modified","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"Linux"},"metrics":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"Linux"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"OSV"}],"rating":"high","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"1618aa3c2e0163f5ac34d514ae89474521910536","lessThan":"4125a194db4a6cf91f619f38788272651cb97dce","status":"affected","versionType":"git"},{"version":"1618aa3c2e0163f5ac34d514ae89474521910536","lessThan":"450e6a685d0cad95b15f8af152057bd0bf79f50b","status":"affected","versionType":"git"},{"version":"1618aa3c2e0163f5ac34d514ae89474521910536","lessThan":"ab1e022379c3c811aa72da8eb0c7507859a1d0f5","status":"affected","versionType":"git"},{"version":"1618aa3c2e0163f5ac34d514ae89474521910536","lessThan":"316fb1b3169efb081d2db910cbbfef445afa03b9","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.10","status":"affected"},{"version":"0","lessThan":"6.10","status":"unaffected","versionType":"semver"},{"version":"6.12.82","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.23","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"6.19.13","lessThanOrEqual":"6.19.*","status":"unaffected","versionType":"semver"},{"version":"7.0","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-754"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/4125a194db4a6cf91f619f38788272651cb97dce","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/450e6a685d0cad95b15f8af152057bd0bf79f50b","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/ab1e022379c3c811aa72da8eb0c7507859a1d0f5","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/316fb1b3169efb081d2db910cbbfef445afa03b9","tags":["Patch","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31666.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31666","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total"},"epss":0.0012,"epssPercentile":0.019,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-31666","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31666","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-31666","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-31666","ok":true,"note":"scored 2026-11-20"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}