{
  "schemaVersion": 1,
  "attribution": [
    {
      "source": "CISA Known Exploited Vulnerabilities",
      "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog",
      "licence": "US government work"
    },
    {
      "source": "GitHub Advisory Database",
      "url": "https://github.com/advisories",
      "licence": "CC BY 4.0"
    },
    {
      "source": "Have I Been Pwned",
      "url": "https://haveibeenpwned.com/",
      "licence": "CC BY 4.0"
    },
    {
      "source": "CVE Program (CVE records)",
      "url": "https://www.cve.org/Legal/TermsOfUse",
      "licence": "CVE Terms of Use",
      "notice": "Copyright © 1999-2026, The MITRE Corporation. CVE is a trademark and the CVE logo is a registered trademark of The MITRE Corporation.",
      "terms": "CVE Usage: MITRE hereby grants you a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Common Vulnerabilities and Exposures (CVE™). Any copy you make for such purposes is authorized provided that you reproduce MITRE's copyright designation and this license in any such copy."
    },
    {
      "source": "FIRST EPSS",
      "url": "https://www.first.org/epss/",
      "licence": "free to use; FIRST requests attribution"
    }
  ],
  "record": {
    "id": "CVE-2025-40205",
    "sourceURL": "https://www.cve.org/CVERecord?id=CVE-2025-40205",
    "idYear": 2025,
    "status": "PUBLISHED",
    "publishedAt": "2025-11-12T21:56:35.403Z",
    "updatedAt": "2026-10-15T22:02:40.845Z",
    "importedAt": "2026-10-24T01:57:34.152Z",
    "snapshot": {
      "id": "cve_2026-10-24_midnight_baseline",
      "at": "2026-10-24T00:00:00.000Z",
      "source": "https://github.com/CVEProject/cvelistV5/releases/tag/cve_2026-10-24_0100Z"
    },
    "facts": {
      "title": "btrfs: avoid potential out-of-bounds in btrfs_encode_fh()",
      "summary": "In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: avoid potential out-of-bounds in btrfs_encode_fh()\n\nThe function btrfs_encode_fh() does not properly account for the three\ncases it handles.\n\nBefore writing to the file handle (fh), the function only returns to the\nuser BTRFS_FID_SIZE_NON_CONNECTABLE (5 dwords, 20 bytes) or\nBTRFS_FID_SIZE_CONNECTABLE (8 dwords, 32 bytes).\n\nHowever, when a parent exists and the root ID of the parent and the\ninode are different, the function writes BTRFS_FID_SIZE_CONNECTABLE_ROOT\n(10 dwords, 40 bytes).\n\nIf *max_len is not large enough, this write goes out of bounds because\nBTRFS_FID_SIZE_CONNECTABLE_ROOT is greater than\nBTRFS_FID_SIZE_CONNECTABLE originally returned.\n\nThis results in an 8-byte out-of-bounds write at\nfid->parent_root_objectid = parent_root_id.\n\nA previous attempt to fix this issue was made but was lost.\n\nhttps://lore.kernel.org/all/4CADAEEC020000780001B32C@vpn.id2.novell.com/\n\nAlthough this issue does not seem to be easily triggerable, it is a\npotential memory corruption bug that should be fixed. This patch\nresolves the issue by ensuring the function returns the appropriate size\nfor all three cases and validates that *max_len is large enough before\nwriting any data.",
      "affected": [
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "status": "affected",
              "versionType": "git",
              "lessThan": "60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db"
            },
            {
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "status": "affected",
              "versionType": "git",
              "lessThan": "742b44342204e5dfe3926433823623c1a0c581df"
            },
            {
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "status": "affected",
              "versionType": "git",
              "lessThan": "d3a9a8e1275eb9b87f006b5562a287aea3f6885f"
            },
            {
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "status": "affected",
              "versionType": "git",
              "lessThan": "d91f6626133698362bba08fbc04bd72c466806d3"
            },
            {
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "status": "affected",
              "versionType": "git",
              "lessThan": "0276c8582488022f057b4cec21975a5edf079f47"
            },
            {
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "status": "affected",
              "versionType": "git",
              "lessThan": "361d67276eb8ec6be8f27f4ad6c6090459438fee"
            },
            {
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "status": "affected",
              "versionType": "git",
              "lessThan": "43143776b0a7604d873d1a6f3e552a00aa930224"
            },
            {
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "status": "affected",
              "versionType": "git",
              "lessThan": "dff4f9ff5d7f289e4545cc936362e01ed3252742"
            }
          ]
        },
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "affected",
          "versions": [
            {
              "version": "2.6.29",
              "status": "affected"
            },
            {
              "version": "0",
              "status": "unaffected",
              "versionType": "semver",
              "lessThan": "2.6.29"
            },
            {
              "version": "5.4.301",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "5.4.*"
            },
            {
              "version": "5.10.246",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "5.10.*"
            },
            {
              "version": "5.15.195",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "5.15.*"
            },
            {
              "version": "6.1.157",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.1.*"
            },
            {
              "version": "6.6.113",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.6.*"
            },
            {
              "version": "6.12.54",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.12.*"
            },
            {
              "version": "6.17.4",
              "status": "unaffected",
              "versionType": "semver",
              "lessThanOrEqual": "6.17.*"
            },
            {
              "version": "6.18",
              "status": "unaffected",
              "versionType": "original_commit_for_fix",
              "lessThanOrEqual": "*"
            }
          ]
        }
      ]
    }
  }
}