xserver/glx
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Peter Hutterer 409394cea8 glx: fix reversed length check in ChangeDrawableAttributes
The request length validation in __glXDisp_ChangeDrawableAttributes and
__glXDispSwap_ChangeDrawableAttributes uses the wrong comparison direction.
The check tests whether the computed request size is LESS THAN
client->req_len, but should test whether it is GREATER THAN. With the
reversed operator, an undersized request (where numAttribs claims more
attribute pairs than the request actually contains) passes validation.

DoChangeDrawableAttributes then iterates numAttribs attribute pairs starting
from the end of the request header, reading past the actual request data
into adjacent memory. This is an out-of-bounds read that can also cause
an out-of-bounds write when a GLX_EVENT_MASK attribute key is found in the
overread data and its corresponding value is written to pGlxDraw->eventMask.

This patch effectively reverts commit 402b329c3a ("glx: Work around
wrong request lengths sent by mesa"). This was fixed in mesa commit
4324d6fdfbba1 in 2011 (mesa 7.11).

Fixes: 402b329c3a ("glx: Work around wrong request lengths sent by mesa")

This vulnerability was discovered by:
Anonymous working with TrendAI Zero Day Initiative

ZDI-CAN-30165

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 19:08:16 +02:00
..
glx_dri
clientinfo.c glx: handle strdup allocation failures 2026-05-01 18:52:04 +02:00
createcontext.c
extension_string.c
extension_string.h
glxcmds.c glx: fix reversed length check in ChangeDrawableAttributes 2026-06-03 19:08:16 +02:00
glxcmdsswap.c glx: fix reversed length check in ChangeDrawableAttributes 2026-06-03 19:08:16 +02:00
glxcontext.h
glxdrawable.h
glxext.c glx: turn retval of xorgGlxCreateVendor() into void 2026-04-23 19:45:53 +02:00
glxext.h glx: glxext.h: add missing includes 2026-04-27 18:20:11 +02:00
glxscreens.c glx: fail if we can't init a screen 2026-04-30 19:54:24 +02:00
glxscreens.h
glxserver.h Treewide: Fix typos 2026-03-16 13:11:07 +01:00
glxutil.h
indirect_dispatch.c
indirect_dispatch.h
indirect_dispatch_swap.c
indirect_program.c
indirect_reqsize.c
indirect_reqsize.h glx: indirect_reqsize.h: move include inside the guards 2026-04-24 13:05:14 +02:00
indirect_size.h
indirect_size_get.c
indirect_size_get.h
indirect_table.c
indirect_table.h
indirect_texture_compression.c
indirect_util.c
indirect_util.h
meson.build glx: move over vndserver.h public SDK header to include/ 2026-02-12 14:25:12 +01:00
render2.c
render2swap.c
renderpix.c
renderpixswap.c
rensize.c
single2.c glx: reject negative size in FeedbackBuffer and SelectBuffer requests 2026-05-21 16:50:52 +02:00
single2swap.c glx: reject negative size in FeedbackBuffer and SelectBuffer requests 2026-05-21 16:50:52 +02:00
singlepix.c
singlepixswap.c
singlesize.c
singlesize.h
swap_interval.c
unpack.h
vnd_dispatch_stubs.c
vndcmds.c
vndext.c
vndserver_priv.h
vndservermapping.c glx: fix duplicate tagInfo->vendor = NULL assignment 2026-06-03 17:47:54 +02:00
vndservervendor.c
vndservervendor.h
xfont.c