{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-21985",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-21985"
  ],
  "published": "2025-04-01T15:46:27Z",
  "summary": "drm/amd/display: Fix out-of-bound accesses",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amd/display: Fix out-of-bound accesses\n\n[WHAT & HOW]\nhpo_stream_to_link_encoder_mapping has size MAX_HPO_DP2_ENCODERS(=4),\nbut location can have size up to 6. As a result, it is necessary to\ncheck location against MAX_HPO_DP2_ENCODERS.\n\nSimiliarly, disp_cfg_stream_location can be used as an array index which\nshould be 0..5, so the ASSERT's conditions should be less without equal.",
  "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-21985"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/36793d90d76f667d26c6dd025571481ee0c96abc"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/9aedc776b11038f04f4641241bb7e877781e4aa4"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8adbb2a98b00926315fd513b5fe2596b5716b82d"
    }
  ],
  "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 vulnerable code is reached only through the local DRM atomic modeset ioctl (`DRM_IOCTL_MODE_ATOMIC`) on /dev/dri/card*, via amdgpu_dm_atomic_check() \u2192 dc_validate_global_state() \u2192 dml2_validate(); no network or remote peer data is involved.\nAC:L - Once a DisplayPort configuration with five or more streams/planes exists (multi-monitor or MST/dock setups, SubVP phantom streams, or primaries plus an MPO overlay), the out-of-bounds index is hit deterministically on every validation pass, and the attacker can re-issue TEST_ONLY atomic commits repeatedly with plane/stream assignments of their choosing.\nPR:L - The atomic ioctl is registered with DRM_MASTER only, which an ordinary unprivileged user holds for their active graphical session on the amdgpu card node \u2014 no root, no capability, and no init-namespace privilege is required.\nUI:N - The attacker performs the atomic commit themselves from their own session; no action by any other user is needed to trigger the out-of-bounds access.\nS:U - The corruption is confined to kernel heap memory belonging to the amdgpu display driver within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The read at hpo_stream_to_link_encoder_mapping[4..5] pulls kernel data from beyond the array into adjacent struct state (g6_temp_read_watermark_set), and the resulting out-of-bounds heap write is a corruption primitive that can be leveraged to shape adjacent kernel objects for disclosure.\nI:H - The out-of-bounds value is used directly as an index into the 8-entry OutputEncoder[] array, producing a 4-byte write at a large, configuration-influenced offset that lands outside the kzalloc'd struct dml2_context, corrupting neighbouring heap objects as well as the DML output configuration that drives display hardware programming.\nA:H - The wild write corrupts kernel heap memory and the display-config state used for bandwidth/watermark programming, leading to oops, slab corruption, or hung/underflowing display output requiring recovery."
    }
  }
}
