{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-40277",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-40277"
  ],
  "published": "2025-12-06T21:53:16Z",
  "summary": "drm/vmwgfx: Validate command header size against SVGA_CMD_MAX_DATASIZE",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/vmwgfx: Validate command header size against SVGA_CMD_MAX_DATASIZE\n\nThis data originates from userspace and is used in buffer offset\ncalculations which could potentially overflow causing an out-of-bounds\naccess.",
  "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": "6.1.159",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-40277"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/e58559845021c3bad5e094219378b869157fad53"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/54d458b244893e47bda52ec3943fdfbc8d7d068b"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/709e5c088f9c99a5cf2c1d1c6ce58f2cca7ab173"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a3abb54c27b2c393c44362399777ad2f6e1ff17e"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b5df9e06eed3df6a4f5c6f8453013b0cabb927b4"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/5aea2cde03d4247cdcf53f9ab7d0747c9dca1cfc"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f3f3a8eb3f0ba799fae057091d8c67cca12d6fa0"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/32b415a9dc2c212e809b7ebc2b14bc3fbda2b9af"
    }
  ],
  "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 bug is reached only through the DRM_IOCTL_VMW_EXECBUF ioctl on the local vmwgfx device/render node (/dev/dri/renderD*), requiring local system access. There is no network or remote path into the command verifier.\nAC:L - The attacker fully and deterministically controls header->size in the command stream they submit; setting it to 0xFFFFFFF8..0xFFFFFFFF reliably wraps the 32-bit size computation and bypasses the size_remaining check every time. No race, timing window, or uncontrollable precondition is involved.\nPR:L - VMW_EXECBUF is declared DRM_RENDER_ALLOW and vmwgfx sets DRIVER_RENDER, so no DRM master or authentication is needed \u2014 any unprivileged local user with access to the render node (standard for graphics/desktop users and containers in VMware guests) can submit commands.\nUI:N - The attacker triggers the flaw entirely on their own by issuing the execbuf ioctl with a crafted SVGA3D command header. No victim action or interaction is required.\nS:U - The integer overflow and the resulting out-of-bounds accesses occur within the guest kernel's own address space and are confined to the kernel's security authority. No hypervisor, IOMMU, or sandbox boundary is crossed by the kernel-side defect itself.\nC:H - The unchecked header->size drives pointer arithmetic in vmw_cmd_dma(), vmw_cmd_draw(), and vmw_cmd_tex_state(), producing large out-of-bounds reads of adjacent kernel memory whose contents are interpreted as resource handles; success/failure of vmw_user_resource_lookup_handle() forms a scanning oracle over kernel heap contents, so arbitrary kernel memory disclosure is achievable.\nI:H - The same overflow yields out-of-bounds writes \u2014 vmw_cmd_dma() writes bo_size into suffix->maximumOffset past the buffer, and OOB-derived relocation offsets cause vmw_resource_relocations_apply() to write 32-bit resource IDs outside the command buffer. Controlled heap corruption of this kind is a standard path to privilege escalation.\nA:H - A header->size of 0xFFFFFFF8 makes *size zero, causing vmw_cmd_check_all() to spin forever while holding dev_priv->cmdbuf_mutex, and the far out-of-bounds reads past a vmalloc'd bounce buffer hit a guard page and oops the kernel. Either outcome is a full denial of service."
    }
  }
}
