{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-40354",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-40354"
  ],
  "published": "2025-12-16T13:30:44Z",
  "summary": "drm/amd/display: increase max link count and fix link->enc NULL pointer access",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amd/display: increase max link count and fix link->enc NULL pointer access\n\n[why]\n1.) dc->links[MAX_LINKS] array size smaller than actual requested.\nmax_connector + max_dpia + 4 virtual = 14.\nincrease from 12 to 14.\n\n2.) hw_init() access null LINK_ENC for dpia non display_endpoint.\n\n(cherry picked from commit d7f5a61e1b04ed87b008c8d327649d184dc5bb45)",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": null,
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-40354"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f28092be4e12b7df9e4f415d25bf0d767bc2d9ed"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a3fc0d36cfb927f8986b83bf5fba47dbedad3c63"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/bec947cbe9a65783adb475a5fb47980d7b4f4796"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The defect is in the amdgpu DC display driver's hardware-init path, reached through local driver probe and suspend/resume (including runtime-PM resume driven by opening /dev/dri/renderD*). There is no network-facing component.\nAC:L - Both the unbounded `dc->links[]` append in create_links() and the NULL `link->link_enc` dereference for DPIA endpoints are deterministic on affected DCN4x configurations \u2014 no race to win and no memory layout beyond the attacker's influence.\nPR:L - The vulnerable init_hw path is re-entered on every runtime-PM/system resume via dm_resume() -> dc_set_power_state(D0), which an unprivileged local user holding an ordinary DRM/render node handle can drive repeatedly; no root or CAP_SYS_ADMIN is required.\nUI:N - No victim action is needed \u2014 the corrupting create_links() loop runs at driver init and the NULL dereference is hit automatically on each hardware init/resume cycle.\nS:U - The out-of-bounds write and NULL dereference stay within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - Overflowing dc->links[] overwrites the adjacent `struct link_service *link_srv`, `current_state`, and `res_pool` pointers in struct dc, so subsequent dc->link_srv->...() dispatches read from an attacker-influenceable heap object, yielding pointer confusion and arbitrary kernel-memory read primitives.\nI:H - This is an out-of-bounds write of pointer values past a fixed array directly onto a function-pointer-table pointer (link_srv), giving a realistic indirect-call hijack and arbitrary write path rather than a bounded corruption.\nA:H - The unfixed DPIA path dereferences a NULL link->link_enc in dcn401_init_hw(), producing a kernel oops on every hardware init/resume, and the adjacent-field corruption reliably panics the machine."
    }
  }
}
