{
  "id": "CVE-2026-31666",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-31666",
  "published_at": "2026-04-24T14:45:15.271Z",
  "title": "btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "cna",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "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. 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.",
  "cwe": "CWE-754",
  "cpes": [
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
    "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:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= 1618aa3c2e0163f5ac34d514ae89474521910536, \u003c 4125a194db4a6cf91f619f38788272651cb97dce",
          "\u003e= 1618aa3c2e0163f5ac34d514ae89474521910536, \u003c 450e6a685d0cad95b15f8af152057bd0bf79f50b",
          "\u003e= 1618aa3c2e0163f5ac34d514ae89474521910536, \u003c ab1e022379c3c811aa72da8eb0c7507859a1d0f5",
          "\u003e= 1618aa3c2e0163f5ac34d514ae89474521910536, \u003c 316fb1b3169efb081d2db910cbbfef445afa03b9"
        ],
        "fixed_in": [
          "4125a194db4a6cf91f619f38788272651cb97dce",
          "450e6a685d0cad95b15f8af152057bd0bf79f50b",
          "ab1e022379c3c811aa72da8eb0c7507859a1d0f5",
          "316fb1b3169efb081d2db910cbbfef445afa03b9"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "6.10"
        ],
        "fixed_in": [
          "0",
          "6.12.82",
          "6.18.23",
          "6.19.13",
          "7.0"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to 4125a194db4a6cf91f619f38788272651cb97dce or 450e6a685d0cad95b15f8af152057bd0bf79f50b or ab1e022379c3c811aa72da8eb0c7507859a1d0f5 or 316fb1b3169efb081d2db910cbbfef445afa03b9 or later.",
      "Upgrade Linux to 0 or 6.12.82 or 6.18.23 or 6.19.13 or 7.0 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
