7.8
HIGH CVSS 3.1
CVE-2026-31666
btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()
Description

In the Linux kernel, the following vulnerability has been resolved: btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref() After commit 1618aa3c2e01 ("btrfs: simplify return variables in lookup_extent_data_ref()"), the err and ret variables were merged into a single ret variable. However, when btrfs_next_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.

INFO

Published Date :

April 24, 2026, 3:16 p.m.

Last Modified :

Nov. 11, 2026, 11:10 p.m.

Remotely Exploit :

No

Source :

416baaa9-dc9f-4396-8d5f-8c081fb06d67
Affected Products

The following products are affected by CVE-2026-31666 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Linux linux_kernel
CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 134c704f-9b21-4f2e-91b3-4a467353bcc0
CVSS 3.1 HIGH 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Solution
Apply the kernel patch to correct extent tree item lookup logic and prevent corruption.
  • Apply the btrfs extent data ref lookup fix.
  • Update the Linux kernel to the patched version.
  • Verify extent tree integrity after update.
References to Advisories, Solutions, and Tools
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2026-31666 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2026-31666 weaknesses.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2026-31666 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2026-31666 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Translated by [email protected]

    Nov. 11, 2026

    Action Type Old Value New Value
    Added Translation Title: Linux Kernel, Description: En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: btrfs: corrige el valor de retorno incorrecto después de cambiar la hoja en lookup_extent_data_ref() Despué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. Corrige esto devolviendo -ENOENT directamente cuando la clave no coincide, en lugar de depender de la variable ret.
  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    Oct. 19, 2026

    Action Type Old Value New Value
    Added CWE CWE-754
  • CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Oct. 16, 2026

    Action Type Old Value New Value
    Added Reference https://git.kernel.org/stable/c/316fb1b3169efb081d2db910cbbfef445afa03b9
    Added Reference https://git.kernel.org/stable/c/4125a194db4a6cf91f619f38788272651cb97dce
    Added Reference https://git.kernel.org/stable/c/450e6a685d0cad95b15f8af152057bd0bf79f50b
    Added Reference https://git.kernel.org/stable/c/ab1e022379c3c811aa72da8eb0c7507859a1d0f5
    Removed Reference https://git.kernel.org/stable/c/316fb1b3169efb081d2db910cbbfef445afa03b9
    Removed Reference https://git.kernel.org/stable/c/4125a194db4a6cf91f619f38788272651cb97dce
    Removed Reference https://git.kernel.org/stable/c/450e6a685d0cad95b15f8af152057bd0bf79f50b
    Removed Reference https://git.kernel.org/stable/c/ab1e022379c3c811aa72da8eb0c7507859a1d0f5
    Removed Reference Type https://git.kernel.org/stable/c/316fb1b3169efb081d2db910cbbfef445afa03b9 Types: Patch
    Removed Reference Type https://git.kernel.org/stable/c/4125a194db4a6cf91f619f38788272651cb97dce Types: Patch
    Removed Reference Type https://git.kernel.org/stable/c/450e6a685d0cad95b15f8af152057bd0bf79f50b Types: Patch
    Removed Reference Type https://git.kernel.org/stable/c/ab1e022379c3c811aa72da8eb0c7507859a1d0f5 Types: Patch
  • CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0

    Oct. 16, 2026

    Action Type Old Value New Value
    Added SSVC {'id': 'CVE-2026-31666', 'role': 'CISA Coordinator', 'options': [{'exploitation': 'none'}, {'automatable': 'no'}, {'technicalImpact': 'total'}], 'version': '2.0.3', 'timestamp': '2026-10-16T15:11:52.641665Z'}
  • CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Jun. 17, 2026

    Action Type Old Value New Value
    Added Affected [{'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '1618aa3c2e0163f5ac34d514ae89474521910536', 'lessThan': '4125a194db4a6cf91f619f38788272651cb97dce', 'versionType': 'git'}, {'status': 'affected', 'version': '1618aa3c2e0163f5ac34d514ae89474521910536', 'lessThan': '450e6a685d0cad95b15f8af152057bd0bf79f50b', 'versionType': 'git'}, {'status': 'affected', 'version': '1618aa3c2e0163f5ac34d514ae89474521910536', 'lessThan': 'ab1e022379c3c811aa72da8eb0c7507859a1d0f5', 'versionType': 'git'}, {'status': 'affected', 'version': '1618aa3c2e0163f5ac34d514ae89474521910536', 'lessThan': '316fb1b3169efb081d2db910cbbfef445afa03b9', 'versionType': 'git'}], 'programFiles': ['fs/btrfs/extent-tree.c'], 'defaultStatus': 'unaffected'}, {'repo': 'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git', 'vendor': 'Linux', 'product': 'Linux', 'versions': [{'status': 'affected', 'version': '6.10'}, {'status': 'unaffected', 'version': '0', 'lessThan': '6.10', 'versionType': 'semver'}, {'status': 'unaffected', 'version': '6.12.82', 'versionType': 'semver', 'lessThanOrEqual': '6.12.*'}, {'status': 'unaffected', 'version': '6.18.23', 'versionType': 'semver', 'lessThanOrEqual': '6.18.*'}, {'status': 'unaffected', 'version': '6.19.13', 'versionType': 'semver', 'lessThanOrEqual': '6.19.*'}, {'status': 'unaffected', 'version': '7.0', 'versionType': 'original_commit_for_fix', 'lessThanOrEqual': '*'}], 'programFiles': ['fs/btrfs/extent-tree.c'], 'defaultStatus': 'affected'}]
  • Initial Analysis by [email protected]

    Apr. 27, 2026

    Action Type Old Value New Value
    Added CWE NVD-CWE-noinfo
    Added CPE Configuration OR *cpe:2.3:o:linux:linux_kernel:6.10:-:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:7.0:rc2:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:7.0:rc3:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:7.0:rc4:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:7.0:rc5:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:7.0:rc6:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:7.0:rc7:*:*:*:*:*:* *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.13 up to (excluding) 6.18.23 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.19 up to (excluding) 6.19.13 *cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* versions from (including) 6.10.1 up to (excluding) 6.12.82
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/316fb1b3169efb081d2db910cbbfef445afa03b9 Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/4125a194db4a6cf91f619f38788272651cb97dce Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/450e6a685d0cad95b15f8af152057bd0bf79f50b Types: Patch
    Added Reference Type kernel.org: https://git.kernel.org/stable/c/ab1e022379c3c811aa72da8eb0c7507859a1d0f5 Types: Patch
  • CVE Modified by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Apr. 27, 2026

    Action Type Old Value New Value
    Added CVSS V3.1 AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • New CVE Received by 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Apr. 24, 2026

    Action Type Old Value New Value
    Added Description In the Linux kernel, the following vulnerability has been resolved: btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref() After commit 1618aa3c2e01 ("btrfs: simplify return variables in lookup_extent_data_ref()"), the err and ret variables were merged into a single ret variable. However, when btrfs_next_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.
    Added Reference https://git.kernel.org/stable/c/316fb1b3169efb081d2db910cbbfef445afa03b9
    Added Reference https://git.kernel.org/stable/c/4125a194db4a6cf91f619f38788272651cb97dce
    Added Reference https://git.kernel.org/stable/c/450e6a685d0cad95b15f8af152057bd0bf79f50b
    Added Reference https://git.kernel.org/stable/c/ab1e022379c3c811aa72da8eb0c7507859a1d0f5
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.