drm/vmwgfx: validate DRAW_PRIMITIVES header size before division
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7a73ba7469cbea631050094fd14f73acebb97cf9 · < dc0be7662b7b0ce28cb5eea864737793ed7b9e70| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drm/vmwgfx: validate DRAW_PRIMITIVES header size before division
vmw_cmd_draw() computes
maxnum = (header->size - sizeof(cmd->body)) / sizeof(*decl);
where header->size is u32 and is taken straight from the user-supplied command stream. When header->size is less than sizeof(cmd->body) the unsigned subtraction wraps to nearly 4 GiB, producing a huge maxnum. Any user-controlled cmd->body.numVertexDecls then passes the bound and the loop dereferences decl[i] far past the end of the kernel command bounce buffer, producing an out-of-bounds read of kernel memory.
Reject undersized headers up front.
From the CVE record · Linux
The Linux kernel’s drm/vmwgfx DRAW_PRIMITIVES handling does not validate a user-supplied header size before subtracting from it. A local attacker able to submit an undersized command can trigger an out-of-bounds read of kernel memory; no additional user interaction is described.
Engineers running Linux kernels with drm/vmwgfx should check whether their kernel includes the fix; affected versions are not specified.