mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-26 01:59:57 +00:00
glx: validate dataBytes against cmdlen in RenderLarge first request
__glXDisp_RenderLarge() allocates the large command buffer based on
cmdlen (from hdr->length, the total command size embedded in the
payload), but copies dataBytes (from req->dataBytes, the payload size
of the current sub-request) into it. The existing length check only
validates that the X11 request length is consistent with dataBytes,
not that dataBytes fits within the cmdlen-sized buffer.
A malicious client can set hdr->length to a small value (e.g. 12 bytes)
while sending a large dataBytes (up to ~256KB or more with
BIG-REQUESTS), causing the memcpy to overflow the cmdlen-sized buffer.
Add a check that dataBytes <= cmdlen before the buffer allocation and
copy on the first request.
This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative
ZDI-CAN-31833
CVE-2026-93517
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2341>
(cherry picked from commit 2abe4632d7)
This commit is contained in:
parent
044f4e15cd
commit
b8668c00f6
1 changed files with 3 additions and 0 deletions
|
|
@ -2195,6 +2195,9 @@ __glXDisp_RenderLarge(__GLXclientState * cl, GLbyte * pc)
|
|||
return BadLength;
|
||||
}
|
||||
|
||||
if (dataBytes > cmdlen)
|
||||
return BadLength;
|
||||
|
||||
/*
|
||||
** Make enough space in the buffer, then copy the entire request.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue