{"id":"CVE-2026-31666","aliases":["CVE-2026-31666"],"related":[],"kind":"vulnerability","state":"published","title":"btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nbtrfs: corrige el valor de retorno incorrecto después de cambiar la hoja en lookup_extent_data_ref()\n\nDespués del commit 1618aa3c2e01 (’btrfs: simplifica las variables de retorno en lookup_extent_data_ref()’), las variables err y ret se fusionaron en una única variable ret. Sin embargo, cuando btrfs_next_leaf() devuelve 0 (éxito), ret se sobrescribe de -ENOENT a 0. Si la primera clave en la siguiente hoja no coincide (diferente objectid o tipo), la función devuelve 0 en lugar de -ENOENT, haciendo que el llamador crea que la búsqueda tuvo éxito cuando no fue así. Esto puede llevar a operaciones en el elemento incorrecto del árbol de extensiones, potencialmente causando corrupción del árbol de extensiones.\n\nCorrige esto devolviendo -ENOENT directamente cuando la clave no coincide, en lugar de depender de la variable ret.","source":"nvd"}],"published":"2026-04-24T14:45:15.271Z","modified":"2026-11-11T23:10:00.263Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-754"],"affected":[{"ranges":[{"type":"git","introduced":"1618aa3c2e0163f5ac34d514ae89474521910536","fixed":"4125a194db4a6cf91f619f38788272651cb97dce","status":"affected"},{"type":"git","introduced":"1618aa3c2e0163f5ac34d514ae89474521910536","fixed":"450e6a685d0cad95b15f8af152057bd0bf79f50b","status":"affected"},{"type":"git","introduced":"1618aa3c2e0163f5ac34d514ae89474521910536","fixed":"ab1e022379c3c811aa72da8eb0c7507859a1d0f5","status":"affected"},{"type":"git","introduced":"1618aa3c2e0163f5ac34d514ae89474521910536","fixed":"316fb1b3169efb081d2db910cbbfef445afa03b9","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.10","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.10","status":"unaffected"},{"type":"semver","introduced":"6.12.82","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.23","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"6.19.13","lastAffected":"6.19.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.0","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.10.1","fixed":"6.12.82"},{"status":"affected","introduced":"6.13","fixed":"6.18.23"},{"status":"affected","introduced":"6.19","fixed":"6.19.13"},{"status":"affected","version":"6.10"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"},{"status":"affected","version":"7.0"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/4125a194db4a6cf91f619f38788272651cb97dce","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/450e6a685d0cad95b15f8af152057bd0bf79f50b","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ab1e022379c3c811aa72da8eb0c7507859a1d0f5","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/316fb1b3169efb081d2db910cbbfef445afa03b9","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-16T15:11:52.641Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-31666","url":"https://www.cve.org/CVERecord?id=CVE-2026-31666","licence":"CVE Terms of Use","modified":"2026-10-19T18:56:02.816Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-31666","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-31666","licence":"Public domain","modified":"2026-11-11T23:10:00.263Z"}],"updatedAt":"2026-11-25T22:59:19.542Z","epss":{"score":0.00125,"percentile":0.02381,"date":"2026-12-01T12:00:22.000Z"}}