{"id":"CVE-2026-31666","published":"2026-04-24T14:45:15Z","modified":"2026-10-19T18:56:02Z","title":"btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.8,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00182,"percentile":0.04561,"provenance":"source"},"cwes":[{"id":"CWE-754","name":"Improper Check for Unusual or Exceptional Conditions"}],"references":[{"url":"https://git.kernel.org/stable/c/4125a194db4a6cf91f619f38788272651cb97dce","tags":[]},{"url":"https://git.kernel.org/stable/c/450e6a685d0cad95b15f8af152057bd0bf79f50b","tags":[]},{"url":"https://git.kernel.org/stable/c/ab1e022379c3c811aa72da8eb0c7507859a1d0f5","tags":[]},{"url":"https://git.kernel.org/stable/c/316fb1b3169efb081d2db910cbbfef445afa03b9","tags":[]}],"priority":{"score":6.4,"factors":[{"name":"EPSS percentile","points":0.91},{"name":"CVSS severity","points":5.46}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 1618aa3c2e0163f5ac34d514ae89474521910536, < 4125a194db4a6cf91f619f38788272651cb97dce",">= 1618aa3c2e0163f5ac34d514ae89474521910536, < 450e6a685d0cad95b15f8af152057bd0bf79f50b",">= 1618aa3c2e0163f5ac34d514ae89474521910536, < ab1e022379c3c811aa72da8eb0c7507859a1d0f5",">= 1618aa3c2e0163f5ac34d514ae89474521910536, < 316fb1b3169efb081d2db910cbbfef445afa03b9"]},{"vendor":"Linux","product":"Linux","versions":["6.10"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-10-16T15:11:52.641665Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-25559","exploited":false,"provenance":"source"}}