CVE-2025-40205 (GCVE-0-2025-40205)

Vulnerability from cvelistv5 – Published: 2025-11-12 21:56 – Updated: 2026-10-15 22:02
VLAI
Title
btrfs: avoid potential out-of-bounds in btrfs_encode_fh()
Summary
In the Linux kernel, the following vulnerability has been resolved: btrfs: avoid potential out-of-bounds in btrfs_encode_fh() The function btrfs_encode_fh() does not properly account for the three cases it handles. Before writing to the file handle (fh), the function only returns to the user BTRFS_FID_SIZE_NON_CONNECTABLE (5 dwords, 20 bytes) or BTRFS_FID_SIZE_CONNECTABLE (8 dwords, 32 bytes). However, when a parent exists and the root ID of the parent and the inode are different, the function writes BTRFS_FID_SIZE_CONNECTABLE_ROOT (10 dwords, 40 bytes). If *max_len is not large enough, this write goes out of bounds because BTRFS_FID_SIZE_CONNECTABLE_ROOT is greater than BTRFS_FID_SIZE_CONNECTABLE originally returned. This results in an 8-byte out-of-bounds write at fid->parent_root_objectid = parent_root_id. A previous attempt to fix this issue was made but was lost. https://lore.kernel.org/all/4CADAEEC020000780001B32C@vpn.id2.novell.com/ Although this issue does not seem to be easily triggerable, it is a potential memory corruption bug that should be fixed. This patch resolves the issue by ensuring the function returns the appropriate size for all three cases and validates that *max_len is large enough before writing any data.
SSVC
Exploitation: none Automatable: no Technical Impact: total
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2026-10-15 21:58 UTC
Assigner
Linux CNA under the mitre root
CNA scorecard D 53/100 over 6843 records in the last 180 days details
Impacted products
Vendor Product Version CPE status
Linux Linux Affected: be6e8dc0ba84029997075a1ec77b4ddb863cbe15 , < 60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db (git)
Affected: be6e8dc0ba84029997075a1ec77b4ddb863cbe15 , < 742b44342204e5dfe3926433823623c1a0c581df (git)
Affected: be6e8dc0ba84029997075a1ec77b4ddb863cbe15 , < d3a9a8e1275eb9b87f006b5562a287aea3f6885f (git)
Affected: be6e8dc0ba84029997075a1ec77b4ddb863cbe15 , < d91f6626133698362bba08fbc04bd72c466806d3 (git)
Affected: be6e8dc0ba84029997075a1ec77b4ddb863cbe15 , < 0276c8582488022f057b4cec21975a5edf079f47 (git)
Affected: be6e8dc0ba84029997075a1ec77b4ddb863cbe15 , < 361d67276eb8ec6be8f27f4ad6c6090459438fee (git)
Affected: be6e8dc0ba84029997075a1ec77b4ddb863cbe15 , < 43143776b0a7604d873d1a6f3e552a00aa930224 (git)
Affected: be6e8dc0ba84029997075a1ec77b4ddb863cbe15 , < dff4f9ff5d7f289e4545cc936362e01ed3252742 (git)
guessed Create a notification for this product.
Linux Linux Affected: 2.6.29
Unaffected: 0 , < 2.6.29 (semver)
Unaffected: 5.4.301 , ≤ 5.4.* (semver)
Unaffected: 5.10.246 , ≤ 5.10.* (semver)
Unaffected: 5.15.195 , ≤ 5.15.* (semver)
Unaffected: 6.1.157 , ≤ 6.1.* (semver)
Unaffected: 6.6.113 , ≤ 6.6.* (semver)
Unaffected: 6.12.54 , ≤ 6.12.* (semver)
Unaffected: 6.17.4 , ≤ 6.17.* (semver)
Unaffected: 6.18 , ≤ * (original_commit_for_fix)
guessed Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2025-40205",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2026-10-15T21:58:09.178444Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2026-10-15T22:02:40.845Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/export.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db",
              "status": "affected",
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "versionType": "git"
            },
            {
              "lessThan": "742b44342204e5dfe3926433823623c1a0c581df",
              "status": "affected",
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "versionType": "git"
            },
            {
              "lessThan": "d3a9a8e1275eb9b87f006b5562a287aea3f6885f",
              "status": "affected",
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "versionType": "git"
            },
            {
              "lessThan": "d91f6626133698362bba08fbc04bd72c466806d3",
              "status": "affected",
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "versionType": "git"
            },
            {
              "lessThan": "0276c8582488022f057b4cec21975a5edf079f47",
              "status": "affected",
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "versionType": "git"
            },
            {
              "lessThan": "361d67276eb8ec6be8f27f4ad6c6090459438fee",
              "status": "affected",
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "versionType": "git"
            },
            {
              "lessThan": "43143776b0a7604d873d1a6f3e552a00aa930224",
              "status": "affected",
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "versionType": "git"
            },
            {
              "lessThan": "dff4f9ff5d7f289e4545cc936362e01ed3252742",
              "status": "affected",
              "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "fs/btrfs/export.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "2.6.29"
            },
            {
              "lessThan": "2.6.29",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.301",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.246",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.15.*",
              "status": "unaffected",
              "version": "5.15.195",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.1.*",
              "status": "unaffected",
              "version": "6.1.157",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.113",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.12.*",
              "status": "unaffected",
              "version": "6.12.54",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.17.*",
              "status": "unaffected",
              "version": "6.17.4",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.18",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.301",
                  "versionStartIncluding": "2.6.29",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.246",
                  "versionStartIncluding": "2.6.29",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15.195",
                  "versionStartIncluding": "2.6.29",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.1.157",
                  "versionStartIncluding": "2.6.29",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.113",
                  "versionStartIncluding": "2.6.29",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.12.54",
                  "versionStartIncluding": "2.6.29",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.4",
                  "versionStartIncluding": "2.6.29",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18",
                  "versionStartIncluding": "2.6.29",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "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-\u003eparent_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."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The primary trigger is the local `name_to_handle_at(AT_HANDLE_CONNECTABLE)` syscall on a mounted btrfs filesystem, where the caller fully controls the destination buffer size. The nfsd path can also reach the encoder remotely, but only with the non-default `subtree_check` export option, so local is the representative vector.\nAC:L - An unprivileged attacker deterministically controls every element they can influence \u2014 the btrfs mount, the target inode, the `AT_HANDLE_CONNECTABLE` flag, and the undersized `handle_bytes` value (8-9 dwords) that makes the 40-byte write overflow \u2014 with no race or memory-layout grooming required.\nPR:L - `name_to_handle_at()` requires no capability (unlike `open_by_handle_at()`, which needs CAP_DAC_READ_SEARCH), so any local unprivileged user with read access to a btrfs mount can invoke the vulnerable encoder. Creating btrfs subvolumes is likewise permitted to unprivileged users with write access to the parent directory.\nUI:N - The attacker triggers the overflow entirely through their own syscall on an already-mounted filesystem; no victim action, no crafted image mount, and no administrator involvement is needed.\nS:U - The out-of-bounds write corrupts kernel heap memory within the same kernel security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - An 8-byte heap out-of-bounds write is a memory-corruption primitive that can be leveraged to overwrite adjacent kernel objects (e.g. length or pointer fields) and thereby obtain arbitrary kernel-memory disclosure.\nI:H - This is a direct out-of-bounds write of a 64-bit value (`parent_root_objectid`) past the end of a kernel allocation, and per CVSS kernel guidance an OOB write is rated High for integrity due to its potential for control-flow hijacking.\nA:H - Corrupting adjacent kernel heap metadata or object state leads to oops, BUG, or panic, and the write is detectable/fatal under KASAN or hardened allocators, causing a full denial of service."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:08:34.187Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db"
        },
        {
          "url": "https://git.kernel.org/stable/c/742b44342204e5dfe3926433823623c1a0c581df"
        },
        {
          "url": "https://git.kernel.org/stable/c/d3a9a8e1275eb9b87f006b5562a287aea3f6885f"
        },
        {
          "url": "https://git.kernel.org/stable/c/d91f6626133698362bba08fbc04bd72c466806d3"
        },
        {
          "url": "https://git.kernel.org/stable/c/0276c8582488022f057b4cec21975a5edf079f47"
        },
        {
          "url": "https://git.kernel.org/stable/c/361d67276eb8ec6be8f27f4ad6c6090459438fee"
        },
        {
          "url": "https://git.kernel.org/stable/c/43143776b0a7604d873d1a6f3e552a00aa930224"
        },
        {
          "url": "https://git.kernel.org/stable/c/dff4f9ff5d7f289e4545cc936362e01ed3252742"
        }
      ],
      "title": "btrfs: avoid potential out-of-bounds in btrfs_encode_fh()",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40205",
    "datePublished": "2025-11-12T21:56:35.403Z",
    "dateReserved": "2025-04-16T07:20:57.179Z",
    "dateUpdated": "2026-10-15T22:02:40.845Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-40205",
      "date": "2026-10-22",
      "epss": "0.00153",
      "percentile": "0.04099"
    },
    "microsoft_vex": {
      "current_release_date": "2025-12-07T01:52:11.000Z",
      "cve": "CVE-2025-40205",
      "id": "msrc_CVE-2025-40205",
      "initial_release_date": "2025-11-02T00:00:00.000Z",
      "product_status:fixed": "1",
      "product_status:known_affected": "1",
      "source": "Microsoft CSAF VEX",
      "status": "final",
      "title": "btrfs: avoid potential out-of-bounds in btrfs_encode_fh()",
      "url": "https://msrc.microsoft.com/csaf/vex/2025/msrc_cve-2025-40205.json",
      "version": "2"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "fs/btrfs/export.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db",
                    "status": "affected",
                    "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "742b44342204e5dfe3926433823623c1a0c581df",
                    "status": "affected",
                    "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "d3a9a8e1275eb9b87f006b5562a287aea3f6885f",
                    "status": "affected",
                    "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "d91f6626133698362bba08fbc04bd72c466806d3",
                    "status": "affected",
                    "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "0276c8582488022f057b4cec21975a5edf079f47",
                    "status": "affected",
                    "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "361d67276eb8ec6be8f27f4ad6c6090459438fee",
                    "status": "affected",
                    "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "43143776b0a7604d873d1a6f3e552a00aa930224",
                    "status": "affected",
                    "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "dff4f9ff5d7f289e4545cc936362e01ed3252742",
                    "status": "affected",
                    "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                    "versionType": "git"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "fs/btrfs/export.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "2.6.29"
                  },
                  {
                    "lessThan": "2.6.29",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.4.*",
                    "status": "unaffected",
                    "version": "5.4.301",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.10.*",
                    "status": "unaffected",
                    "version": "5.10.246",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.15.*",
                    "status": "unaffected",
                    "version": "5.15.195",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.1.*",
                    "status": "unaffected",
                    "version": "6.1.157",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.6.*",
                    "status": "unaffected",
                    "version": "6.6.113",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.12.*",
                    "status": "unaffected",
                    "version": "6.12.54",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "6.17.*",
                    "status": "unaffected",
                    "version": "6.17.4",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "6.18",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "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-\u003eparent_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."
          },
          {
            "lang": "es",
            "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nbtrfs: evita un potencial desbordamiento de l\u00edmites en btrfs_encode_fh()\n\nLa funci\u00f3n btrfs_encode_fh() no tiene en cuenta adecuadamente los tres casos que maneja.\n\nAntes de escribir en el descriptor de archivo (fh), la funci\u00f3n solo devuelve al usuario BTRFS_FID_SIZE_NON_CONNECTABLE (5 dwords, 20 bytes) o BTRFS_FID_SIZE_CONNECTABLE (8 dwords, 32 bytes).\n\nSin embargo, cuando existe un padre y el ID ra\u00edz del padre y el inodo son diferentes, la funci\u00f3n escribe BTRFS_FID_SIZE_CONNECTABLE_ROOT (10 dwords, 40 bytes).\n\nSi *max_len no es lo suficientemente grande, esta escritura se desborda porque BTRFS_FID_SIZE_CONNECTABLE_ROOT es mayor que BTRFS_FID_SIZE_CONNECTABLE devuelto originalmente.\n\nEsto resulta en una escritura fuera de l\u00edmites de 8 bytes en fid-\u003eparent_root_objectid = parent_root_id.\n\nSe hizo un intento previo para solucionar este problema, pero se perdi\u00f3.\n\nhttps://lore.kernel.org/all/4CADAEEC020000780001B32C@vpn.id2.novell.com/\n\nAunque este problema no parece ser f\u00e1cilmente activable, es un potencial error de corrupci\u00f3n de memoria que deber\u00eda ser corregido. Este parche resuelve el problema asegurando que la funci\u00f3n devuelva el tama\u00f1o apropiado para los tres casos y valida que *max_len sea lo suficientemente grande antes de escribir cualquier dato."
          }
        ],
        "id": "CVE-2025-40205",
        "lastModified": "2026-10-19T21:10:00.160",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.9,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            }
          ],
          "ssvcV203": [
            {
              "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "ssvcData": {
                "id": "CVE-2025-40205",
                "options": [
                  {
                    "exploitation": "none"
                  },
                  {
                    "automatable": "no"
                  },
                  {
                    "technicalImpact": "total"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2026-10-15T21:58:09.178444Z",
                "version": "2.0.3"
              }
            }
          ]
        },
        "published": "2025-11-12T22:15:47.773",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/0276c8582488022f057b4cec21975a5edf079f47"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/361d67276eb8ec6be8f27f4ad6c6090459438fee"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/43143776b0a7604d873d1a6f3e552a00aa930224"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/742b44342204e5dfe3926433823623c1a0c581df"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/d3a9a8e1275eb9b87f006b5562a287aea3f6885f"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/d91f6626133698362bba08fbc04bd72c466806d3"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "url": "https://git.kernel.org/stable/c/dff4f9ff5d7f289e4545cc936362e01ed3252742"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Deferred"
      }
    },
    "redhat_vex": {
      "aggregate_severity": "Low",
      "current_release_date": "2026-07-30T10:08:02+00:00",
      "cve": "CVE-2025-40205",
      "id": "CVE-2025-40205",
      "initial_release_date": "2025-11-12T00:00:00+00:00",
      "product_status:known_affected": "42",
      "product_status:known_not_affected": "232",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: btrfs: avoid potential out-of-bounds in btrfs_encode_fh()",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-40205.json",
      "version": "3"
    },
    "vulnrichment": {
      "containers": {
        "adp": [
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2025-40205",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "total"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2026-10-15T21:58:09.178444Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2026-10-15T21:58:10.143Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "defaultStatus": "unaffected",
              "product": "Linux",
              "programFiles": [
                "fs/btrfs/export.c"
              ],
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "vendor": "Linux",
              "versions": [
                {
                  "lessThan": "60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db",
                  "status": "affected",
                  "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                  "versionType": "git"
                },
                {
                  "lessThan": "742b44342204e5dfe3926433823623c1a0c581df",
                  "status": "affected",
                  "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                  "versionType": "git"
                },
                {
                  "lessThan": "d3a9a8e1275eb9b87f006b5562a287aea3f6885f",
                  "status": "affected",
                  "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                  "versionType": "git"
                },
                {
                  "lessThan": "d91f6626133698362bba08fbc04bd72c466806d3",
                  "status": "affected",
                  "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                  "versionType": "git"
                },
                {
                  "lessThan": "0276c8582488022f057b4cec21975a5edf079f47",
                  "status": "affected",
                  "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                  "versionType": "git"
                },
                {
                  "lessThan": "361d67276eb8ec6be8f27f4ad6c6090459438fee",
                  "status": "affected",
                  "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                  "versionType": "git"
                },
                {
                  "lessThan": "43143776b0a7604d873d1a6f3e552a00aa930224",
                  "status": "affected",
                  "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                  "versionType": "git"
                },
                {
                  "lessThan": "dff4f9ff5d7f289e4545cc936362e01ed3252742",
                  "status": "affected",
                  "version": "be6e8dc0ba84029997075a1ec77b4ddb863cbe15",
                  "versionType": "git"
                }
              ]
            },
            {
              "defaultStatus": "affected",
              "product": "Linux",
              "programFiles": [
                "fs/btrfs/export.c"
              ],
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "vendor": "Linux",
              "versions": [
                {
                  "status": "affected",
                  "version": "2.6.29"
                },
                {
                  "lessThan": "2.6.29",
                  "status": "unaffected",
                  "version": "0",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "5.4.*",
                  "status": "unaffected",
                  "version": "5.4.301",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "5.10.*",
                  "status": "unaffected",
                  "version": "5.10.246",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "5.15.*",
                  "status": "unaffected",
                  "version": "5.15.195",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.1.*",
                  "status": "unaffected",
                  "version": "6.1.157",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.6.*",
                  "status": "unaffected",
                  "version": "6.6.113",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.12.*",
                  "status": "unaffected",
                  "version": "6.12.54",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "6.17.*",
                  "status": "unaffected",
                  "version": "6.17.4",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "*",
                  "status": "unaffected",
                  "version": "6.18",
                  "versionType": "original_commit_for_fix"
                }
              ]
            }
          ],
          "cpeApplicability": [
            {
              "nodes": [
                {
                  "cpeMatch": [
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.4.301",
                      "versionStartIncluding": "2.6.29",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.10.246",
                      "versionStartIncluding": "2.6.29",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.15.195",
                      "versionStartIncluding": "2.6.29",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.1.157",
                      "versionStartIncluding": "2.6.29",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.6.113",
                      "versionStartIncluding": "2.6.29",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.12.54",
                      "versionStartIncluding": "2.6.29",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.17.4",
                      "versionStartIncluding": "2.6.29",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "6.18",
                      "versionStartIncluding": "2.6.29",
                      "vulnerable": true
                    }
                  ],
                  "negate": false,
                  "operator": "OR"
                }
              ]
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "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-\u003eparent_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."
            }
          ],
          "metrics": [
            {
              "cvssV3_1": {
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "scenarios": [
                {
                  "lang": "en",
                  "value": "AV:L - The primary trigger is the local `name_to_handle_at(AT_HANDLE_CONNECTABLE)` syscall on a mounted btrfs filesystem, where the caller fully controls the destination buffer size. The nfsd path can also reach the encoder remotely, but only with the non-default `subtree_check` export option, so local is the representative vector.\nAC:L - An unprivileged attacker deterministically controls every element they can influence \u2014 the btrfs mount, the target inode, the `AT_HANDLE_CONNECTABLE` flag, and the undersized `handle_bytes` value (8-9 dwords) that makes the 40-byte write overflow \u2014 with no race or memory-layout grooming required.\nPR:L - `name_to_handle_at()` requires no capability (unlike `open_by_handle_at()`, which needs CAP_DAC_READ_SEARCH), so any local unprivileged user with read access to a btrfs mount can invoke the vulnerable encoder. Creating btrfs subvolumes is likewise permitted to unprivileged users with write access to the parent directory.\nUI:N - The attacker triggers the overflow entirely through their own syscall on an already-mounted filesystem; no victim action, no crafted image mount, and no administrator involvement is needed.\nS:U - The out-of-bounds write corrupts kernel heap memory within the same kernel security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - An 8-byte heap out-of-bounds write is a memory-corruption primitive that can be leveraged to overwrite adjacent kernel objects (e.g. length or pointer fields) and thereby obtain arbitrary kernel-memory disclosure.\nI:H - This is a direct out-of-bounds write of a 64-bit value (`parent_root_objectid`) past the end of a kernel allocation, and per CVSS kernel guidance an OOB write is rated High for integrity due to its potential for control-flow hijacking.\nA:H - Corrupting adjacent kernel heap metadata or object state leads to oops, BUG, or panic, and the write is detectable/fatal under KASAN or hardened allocators, causing a full denial of service."
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-08-05T12:08:34.187Z",
            "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "shortName": "Linux"
          },
          "references": [
            {
              "url": "https://git.kernel.org/stable/c/60de2f55d2aca53e81b4ef2a67d7cc9e1eb677db"
            },
            {
              "url": "https://git.kernel.org/stable/c/742b44342204e5dfe3926433823623c1a0c581df"
            },
            {
              "url": "https://git.kernel.org/stable/c/d3a9a8e1275eb9b87f006b5562a287aea3f6885f"
            },
            {
              "url": "https://git.kernel.org/stable/c/d91f6626133698362bba08fbc04bd72c466806d3"
            },
            {
              "url": "https://git.kernel.org/stable/c/0276c8582488022f057b4cec21975a5edf079f47"
            },
            {
              "url": "https://git.kernel.org/stable/c/361d67276eb8ec6be8f27f4ad6c6090459438fee"
            },
            {
              "url": "https://git.kernel.org/stable/c/43143776b0a7604d873d1a6f3e552a00aa930224"
            },
            {
              "url": "https://git.kernel.org/stable/c/dff4f9ff5d7f289e4545cc936362e01ed3252742"
            }
          ],
          "title": "btrfs: avoid potential out-of-bounds in btrfs_encode_fh()",
          "x_generator": {
            "engine": "bippy-1.2.0"
          }
        }
      },
      "cveMetadata": {
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "assignerShortName": "Linux",
        "cveId": "CVE-2025-40205",
        "datePublished": "2025-11-12T21:56:35.403Z",
        "dateReserved": "2025-04-16T07:20:57.179Z",
        "dateUpdated": "2026-10-15T22:02:40.845Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.