{"id":"CVE-2025-40277","state":"PUBLISHED","title":"drm/vmwgfx: Validate command header size against SVGA_CMD_MAX_DATASIZE","description":"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.","publishedAt":"2025-12-06T21:51:00.437Z","updatedAt":"2026-08-05T12:09:09.886Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"e58559845021c3bad5e094219378b869157fad53","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"54d458b244893e47bda52ec3943fdfbc8d7d068b","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"709e5c088f9c99a5cf2c1d1c6ce58f2cca7ab173","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"a3abb54c27b2c393c44362399777ad2f6e1ff17e","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"b5df9e06eed3df6a4f5c6f8453013b0cabb927b4","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"5aea2cde03d4247cdcf53f9ab7d0747c9dca1cfc","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"f3f3a8eb3f0ba799fae057091d8c67cca12d6fa0","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"32b415a9dc2c212e809b7ebc2b14bc3fbda2b9af","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.3","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.3","versionType":"semver"},{"version":"5.4.302","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.247","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.197","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.159","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.117","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.59","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.9","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c"]}],"references":["https://git.kernel.org/stable/c/e58559845021c3bad5e094219378b869157fad53","https://git.kernel.org/stable/c/54d458b244893e47bda52ec3943fdfbc8d7d068b","https://git.kernel.org/stable/c/709e5c088f9c99a5cf2c1d1c6ce58f2cca7ab173","https://git.kernel.org/stable/c/a3abb54c27b2c393c44362399777ad2f6e1ff17e","https://git.kernel.org/stable/c/b5df9e06eed3df6a4f5c6f8453013b0cabb927b4","https://git.kernel.org/stable/c/5aea2cde03d4247cdcf53f9ab7d0747c9dca1cfc","https://git.kernel.org/stable/c/f3f3a8eb3f0ba799fae057091d8c67cca12d6fa0","https://git.kernel.org/stable/c/32b415a9dc2c212e809b7ebc2b14bc3fbda2b9af"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/40xxx/CVE-2025-40277.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40277","state":"PUBLISHED","datePublished":"2025-12-06T21:51:00.437Z","dateUpdated":"2026-08-05T12:09:09.886Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.184Z"},"containers":{"cna":{"title":"drm/vmwgfx: Validate command header size against SVGA_CMD_MAX_DATASIZE","descriptions":[{"lang":"en","value":"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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"e58559845021c3bad5e094219378b869157fad53","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"54d458b244893e47bda52ec3943fdfbc8d7d068b","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"709e5c088f9c99a5cf2c1d1c6ce58f2cca7ab173","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"a3abb54c27b2c393c44362399777ad2f6e1ff17e","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"b5df9e06eed3df6a4f5c6f8453013b0cabb927b4","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"5aea2cde03d4247cdcf53f9ab7d0747c9dca1cfc","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"f3f3a8eb3f0ba799fae057091d8c67cca12d6fa0","versionType":"git"},{"version":"8ce75f8ab9044fe11caaaf2b2c82471023212f9f","status":"affected","lessThan":"32b415a9dc2c212e809b7ebc2b14bc3fbda2b9af","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.3","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.3","versionType":"semver"},{"version":"5.4.302","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.247","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.197","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.159","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.117","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.59","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.9","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/e58559845021c3bad5e094219378b869157fad53"},{"url":"https://git.kernel.org/stable/c/54d458b244893e47bda52ec3943fdfbc8d7d068b"},{"url":"https://git.kernel.org/stable/c/709e5c088f9c99a5cf2c1d1c6ce58f2cca7ab173"},{"url":"https://git.kernel.org/stable/c/a3abb54c27b2c393c44362399777ad2f6e1ff17e"},{"url":"https://git.kernel.org/stable/c/b5df9e06eed3df6a4f5c6f8453013b0cabb927b4"},{"url":"https://git.kernel.org/stable/c/5aea2cde03d4247cdcf53f9ab7d0747c9dca1cfc"},{"url":"https://git.kernel.org/stable/c/f3f3a8eb3f0ba799fae057091d8c67cca12d6fa0"},{"url":"https://git.kernel.org/stable/c/32b415a9dc2c212e809b7ebc2b14bc3fbda2b9af"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"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 — 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 — 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."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:09:09.886Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.3","versionEndExcluding":"5.4.302"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.3","versionEndExcluding":"5.10.247"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.3","versionEndExcluding":"5.15.197"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.3","versionEndExcluding":"6.1.159"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.3","versionEndExcluding":"6.6.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.3","versionEndExcluding":"6.12.59"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.3","versionEndExcluding":"6.17.9"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.3","versionEndExcluding":"6.18"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-06-16T19:51:12.603019Z","id":"CVE-2025-40277","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-06-16T19:51:24.946Z"}}]}}}