xserver/Xext/glx
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Peter Hutterer 02359bf013 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)
2026-10-20 19:49:20 +02:00
..
glx_dri xext: glx: use stdbool's 'bool' instead of 'Bool' for local variables 2026-08-07 14:24:00 +02:00
clientinfo.c
createcontext.c glx: fix integer overflow in CreateContextAttribsARB length check 2026-06-23 17:29:07 +02:00
extension_string.c glx: parentheses around macro argument symbols 2026-06-25 06:53:42 +02:00
extension_string.h Xext/glx: exports symbols to make extension shared 2026-07-28 12:31:45 +02:00
glxcmds.c glx: validate dataBytes against cmdlen in RenderLarge first request 2026-10-20 19:49:20 +02:00
glxcmdsswap.c
glxcontext.h
glxdrawable.h
glxext.c glx: fix DrawableGone use-after-free without rejecting duplicate drawables 2026-07-21 13:22:41 +02:00
glxext.h
glxscreens.c treewide: replace min/max macros by non-exported MIN/MAX and deprecate them 2026-06-25 14:06:17 +02:00
glxscreens.h Xext/glx: exports symbols to make extension shared 2026-07-28 12:31:45 +02:00
glxserver.h Xext/glx: exports symbols to make extension shared 2026-07-28 12:31:45 +02:00
glxutil.h Xext/glx: exports symbols to make extension shared 2026-07-28 12:31:45 +02:00
indirect_dispatch.c
indirect_dispatch.h
indirect_dispatch_swap.c
indirect_program.c glx: use rpcbuf reply path in GetCompressedTexImage / GetProgramString 2026-06-26 19:34:14 +02:00
indirect_reqsize.c
indirect_reqsize.h
indirect_size.h
indirect_size_get.c
indirect_size_get.h
indirect_table.c
indirect_table.h glx: parentheses around macro argument symbols 2026-06-25 06:53:42 +02:00
indirect_texture_compression.c glx: use rpcbuf reply path in GetCompressedTexImage / GetProgramString 2026-06-26 19:34:14 +02:00
indirect_util.c glx: use rpcbuf reply path in __glXSendReplySwap() 2026-06-26 19:34:14 +02:00
indirect_util.h
meson.build
render2.c
render2swap.c
renderpix.c
renderpixswap.c
rensize.c glx: parentheses around macro argument symbols 2026-06-25 06:53:42 +02:00
single2.c glx: send empty Finish reply via X_SEND_REPLY_SIMPLE() 2026-06-26 19:34:14 +02:00
single2swap.c glx: send empty Finish reply via X_SEND_REPLY_SIMPLE() 2026-06-26 19:34:14 +02:00
singlepix.c glx: use rpcbuf reply path in singlepix.c pixel queries 2026-06-26 19:34:14 +02:00
singlepixswap.c glx: use rpcbuf reply path in singlepixswap.c pixel queries 2026-06-26 19:34:14 +02:00
singlesize.c
singlesize.h
swap_interval.c
unpack.h GLX: fix stale returnBufSize leading to NULL deref in __GLX_GET_ANSWER_BUFFER 2026-08-24 13:40:12 +02:00
vnd_dispatch_stubs.c
vndcmds.c glx: free old context tag before allocating new one in CommonMakeCurrent 2026-07-13 16:07:52 +02:00
vndext.c
vndserver_priv.h
vndservermapping.c
vndservervendor.c
vndservervendor.h
xfont.c glx: move GLYPHPADBYTES out of the SDK into its sole user 2026-06-29 15:49:32 +02:00