Commit graph

23,197 commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
ff7ab3bd33 .github: job for automatically restarting jobs on transient failure
Some checks failed
Build X servers / drivers-build-ubuntu (video-rendition:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-s3virge:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-savage:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-siliconmotion:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sis:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sisusb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg14:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg3:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg6:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunffb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunleo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suntcx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-tdfx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-trident:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-v4l:25.0.1) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vbox:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vesa:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vmware:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-voodoo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-xgi:25.0.0) (push) Has been cancelled
Build X servers / xserver-build-mingw32-ubuntu (push) Has been cancelled
Build X servers / xserver-build-macos (push) Has been cancelled
Build X servers / xserver-build-freebsd (push) Has been cancelled
Build X servers / xserver-build-dragonflybsd (push) Has been cancelled
Build X servers / xserver-build-netbsd (push) Has been cancelled
Build X servers / xserver-build-cygwin (push) Has been cancelled
Build X servers / xserver-build-arch (push) Has been cancelled
Build X servers / Check Signed-Off-By (push) Has been cancelled
Build X servers / Release pushed tag (push) Has been cancelled
check PRs for merge conflicts / notify (push) Has been cancelled
Runs every 15 mins, checks for jobs with transient failure (job broke
after 20mins) and automatically restarts those.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-12 13:04:59 +02:00
Enrico Weigelt, metux IT consult
b524471bc7 xquartz: osxcompat.h: guard HAS_LIBDISPATCH to avoid -Wmacro-redefined
Some checks failed
Build X servers / drivers-build-ubuntu (video-rendition:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-s3virge:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-savage:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-siliconmotion:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sis:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sisusb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg14:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg3:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suncg6:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunffb:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-sunleo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-suntcx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-tdfx:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-trident:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-v4l:25.0.1) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vbox:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vesa:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-vmware:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-voodoo:25.0.0) (push) Has been cancelled
Build X servers / drivers-build-ubuntu (video-xgi:25.0.0) (push) Has been cancelled
Build X servers / xserver-build-mingw32-ubuntu (push) Has been cancelled
Build X servers / xserver-build-macos (push) Has been cancelled
Build X servers / xserver-build-freebsd (push) Has been cancelled
Build X servers / xserver-build-dragonflybsd (push) Has been cancelled
Build X servers / xserver-build-netbsd (push) Has been cancelled
Build X servers / xserver-build-cygwin (push) Has been cancelled
Build X servers / xserver-build-arch (push) Has been cancelled
Build X servers / Check Signed-Off-By (push) Has been cancelled
Build X servers / Release pushed tag (push) Has been cancelled
check PRs for merge conflicts / notify (push) Has been cancelled
The header defines HAS_LIBDISPATCH (empty value) while the build system
passes -DHAS_LIBDISPATCH on the command line, which Clang expands to

Add an #ifndef guard and explicit value so both definitions agree.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-11 16:22:46 +02:00
Enrico Weigelt, metux IT consult
160195ee47 .github: switch arch build job to callmetango's archlinux-build-package-action
My onwn fork isn't needed anymore, switch to upstream.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-10 16:53:16 +02:00
stefan11111
d482f4482b glamor/glamor_egl: Set gl vendor to "nvidia" by default for nvidia cards
Also pick an `EGLDeviceEXT` suitable for nvidia's gl library.

For nvidia 470 and below, there isn't an official gbm backend.
If the dumb backend is used, we can't initialze on the gbm platform.
If the mesa backend is used, we can initialize on the gbm platform,
but if we do, we risk EGL internally picking the wrong `EGLDeviceEXT`

See: https://github.com/X11Libre/xserver/pull/2847

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
c26aa9e5fa glamor/glamor_egl: Only try the fast bo import path on the gbm platform
Even on the gbm platform, it is questionable if gbm bo's are native pixmaps.
However, I don't see any way that they could be native pixmaps on the device platform.

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
ae9ed0b4b8 glamor/glamor_egl: Free the result from drmGetRenderDeviceNameFromFd
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
b6b9338059 glamor/glamor_egl: Fix glamor_egl_device_get_fd error return value
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
7c6a3be672 glamor/glamor_egl: Update glamor_egl_can_texture_gbm_bo
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
abfd0aee2d glamor/glamor_egl: Actually fall back to GLES if creating a GL context fails
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
e760fc9ef6 kdrive/fbdev: Log info about glamor DRI3 capabilities
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
dd77c3ff51 kdrive/fbdev: Use the gbm_forbidden and partial_dri_allowed glamor egl options
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
d38e1bd238 glamor/glamor_egl: Improve nvidia detection
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
4345efa8f8 glamor/glamor_egl: Use the return value of glamor_create_texture_from_image
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
206b8d1094 glamor/glamor_egl: Add flag to explicitly disable libgbm
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
f833931dfa glamor/glamor_egl: Allow missing GL_OES_EGL_image
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
stefan11111
f69b5a3fb4 glamor/glamor_egl: Decouple DRI3 from gbm
glamor_egl's DRI3 implementation now works even without libgbm.

Notably, this allows glamor to work with the nvidia 470 kernel driver

Further patches will refine this.

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-06-10 16:19:13 +02:00
Enrico Weigelt, metux IT consult
e1e57f1939 xquartz: remove unused variable 'i' in QuartzHide()
The variable 'i' was left over from before the DIX_FOR_EACH_SCREEN()
macro replaced the manual loop. Remove it to fix -Wunused-variable.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-10 16:18:17 +02:00
Michel Dänzer
6928daf585 dri2: Deduplicate attachments in do_get_buffer
It was always the intention of the DRI2 protocol that there's at most
one instance of each attachment, and that's how it was implemented in
Mesa.

Since that wasn't enforced though, there might be other clients in the
wild which (e.g. accidentally) request the same attachment multiple
times. So starting to a raise a protocol error in this case now risks
breaking such clients.

Instead, just deduplicate the attachments using a bit-set.

This has a couple of desirable side effects:

* destroy_buffer cannot be called multiple times for the same
  DRI2BufferPtr.
* The client cannot cause the server to allocate a buffers array with
  more entries than there are attachments (currently 11).

changes by mtx: fix FTBS by dropping now unused have_fake_front variable.

Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-10 15:52:17 +02:00
Enrico Weigelt, metux IT consult
b158f35a6d meson: fix features requiring >= 1.0.0 to keep minimum 0.61.0
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-10 13:01:22 +02:00
Enrico Weigelt, metux IT consult
69705d1291 meson_options.txt: fix boolean option value type
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-09 17:12:10 +02:00
Enrico Weigelt, metux IT consult
1bc5ad67a9 test: pyxtest: fix meson.build
fallout of picking from Xorg: we don't have build_xwayland anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-09 12:09:13 +02:00
Enrico Weigelt, metux IT consult
df6dd17bf9 xwin: catch potential realloc() failure winInitializeScreens()
In the unlikely case that realloc() fails on screen init, it's better
to have a decdent error message instead of just segfault.
(at that point we don't have any serious way for recovery anyways,
thus FatalError() is appropriate here)

X-Co-Slopped-By: BigPickle
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-09 12:09:00 +02:00
b-aaz
a7f884f66e Adds #mesondefine for conf variable added in a86be24e.
This configuration variable was getting defined in `include/meson.build`
but it didn't have a #mesondefine "anchor" in
`hw/xfree86/xlibre-server.h.meson.in`, so it did not end up in the
configuration headers, and lead to broken builds (due
to a double define of `pci_device_is_boot_display`) with libpciaccess
version 19.

Added the appropriate #mesondefine line to fix it.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
2026-06-08 18:51:55 +02:00
Peter Hutterer
cb363306b5 glamor: fix an error path cleanup
The GL_OUT_OF_MEMORY error path returns NULL without freeing the
allocated `bits` buffer or deleting the GL texture.

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2233>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 16:21:35 +02:00
Peter Hutterer
dc9c2f802f test/pyxtest: add test for ScreenSaverFreeAttr stale pPriv code path
Add TestScreenSaverFreeAttr which exercises the ScreenSaverFreeAttr
code path by setting attributes, activating the screen saver, then
closing the client connection (triggering resource cleanup).

While ScreenSaverFreeAttr currently does not dereference pPriv after
CheckScreenPrivate, this test verifies the code path is safe and
would catch regressions if future code changes introduced a stale
pointer dereference (same pattern as ZDI-CAN-30168).

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-08 14:00:03 +02:00
Peter Hutterer
0bce5476c4 test/pyxtest: add test for font alias stack overflow (ZDI-CAN-30136)
Add ListFonts, SetFontPath, and GetFontPath protocol builders to
proto/x11.py and a regression test that reproduces the
doListFontsAndAliases stack buffer overflow.

The test creates a temporary font directory with a fonts.alias file
containing an alias whose target name is 400 bytes -- exceeding the
old XLFDMAXFONTNAMELEN of 256 but under libXfont2's MAXFONTNAMELEN of
1024. It prepends this directory to the font path via SetFontPath, then
sends ListFonts matching the alias name. Without the fix, the server
would copy the oversized resolved name into a 256-byte stack buffer,
causing a stack buffer overflow.

ZDI-CAN-30136

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-08 14:00:03 +02:00
Peter Hutterer
2d4a997067 test/pyxtest: add test for XKB mapWidths stack OOB write (ZDI-CAN-30161)
Add a regression test that reproduces the mapWidths stack buffer overflow
in CheckKeyTypes.

The test sends two XkbSetMap requests: first with firstType=0, nTypes=255,
ResizeTypes to expand the type table to 255 entries, then with
firstType=255, nTypes=10, ResizeTypes. The second request passes the
firstType > num_types check (255 > 255 is false) and computes
nMaps = 255 + 10 = 265. Without the fix, the loop would write
mapWidths[255..264], overflowing 9 bytes past the 256-element stack
buffer into adjacent stack variables.

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-08 14:00:03 +02:00
Peter Hutterer
37f3461924 test/pyxtest: add test for XKB num_levels stack overflow (ZDI-CAN-30160)
Add a regression test that reproduces the XKB num_levels stack overflow.

The test sends an XkbSetMap request with XkbSetMapResizeTypes that includes
a non-canonical key type with numLevels=255, exceeding XkbMaxShiftLevel
(63). Without the fix, this type would be accepted and stored in the
server's type table. A subsequent ChangeKeyboardMapping would trigger
XkbUpdateKeyTypesFromCore -> XkbKeyTypesForCoreSymbols, where the
oversized num_levels is used as groupsWidth, causing indices into the
tsyms[252] stack buffer to reach up to 1019 and overflow.

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-08 14:00:03 +02:00
Peter Hutterer
83d6455813 test/pyxtest: add test for ScreenSaver CreateSaverWindow UAF (ZDI-CAN-30168)
Add screensaver protocol builders for SetAttributes, UnsetAttributes, and
ForceScreenSaver, then add a regression test that reproduces the
CreateSaverWindow use-after-free.

The test sequence:
1. SetAttributes(root, 100x100, mask=0) - creates screen private with attr
2. ForceScreenSaver(Active) - creates the saver window
3. UnsetAttributes(root) - clears pPriv->attr to NULL
4. ForceScreenSaver(Active) - re-enters CreateSaverWindow

Without the fix, step 4 triggers CheckScreenPrivate which finds all fields
empty (attr=NULL, events=NULL, hasWindow=FALSE, installedMap=None), frees
pPriv, and sets the screen private to NULL. The function then dereferences
the freed pPriv->attr pointer, causing a use-after-free.

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-08 14:00:03 +02:00
Peter Hutterer
369b5f51b4 test/pyxtest: add test for SyncChangeCounter trigger list UAF (ZDI-CAN-30164)
Add a regression test that reproduces the SyncChangeCounter use-after-free.

The test creates a counter (value=0) and issues SyncAwait with two
conditions on the same counter, both waiting for value >= 1. A second
client then calls SetCounter to set the value to 100. SyncChangeCounter
iterates triggers; the first fires and FreeAwait frees all sibling trigger
list nodes via SyncDeleteTriggerFromSyncObject. Without the fix, the saved
pnext pointer would dangle, and the next iteration would dereference freed
heap memory.

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-08 14:00:03 +02:00
Peter Hutterer
f2331c651c test/pyxtest: add tests for miSyncDestroyFence/FreeCounter (ZDI-CAN-30159/30163)
Add SYNC extension protocol builders (proto/sync.py) and a regression test
that reproduces the miSyncDestroyFence and FreeCounter use-after-free.

The first test creates a fence and issues AwaitFence with the same fence ID
listed twice, creating two trigger list nodes pointing into one
SyncAwaitUnion. A second client then destroys the fence. Without the fix,
miSyncDestroyFence would invoke CounterDestroyed before saving the next
pointer, and the first callback would free the SyncAwaitUnion while the
second trigger list node still referenced it.

The second test creates a counter (value=0) and issues SyncAwait with two
conditions on the same counter, both waiting for value >= 1. Since the
counter is 0, Client A blocks. A second client then destroys the counter.
Without the fix, FreeCounter would invoke CounterDestroyed before saving
the next pointer in the trigger list, and the first callback would free
the SyncAwaitUnion while the second trigger node still referenced it.

ZDI-CAN-30163 (FreeCounter)
ZDI-CAN-30159 (miSyncDestroyFence)

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-08 14:00:03 +02:00
Peter Hutterer
663c20362e test/pyxtest: add test for GLX ChangeDrawableAttributes OOB read (ZDI-CAN-30165)
Add GLX extension protocol builders (proto/glx.py) and a regression test
that reproduces the reversed length check in ChangeDrawableAttributes.

The test creates a GLX context on the root visual, binds it with
MakeCurrent (which auto-creates a GLXDrawable), then sends a
ChangeDrawableAttributes request with length=3 (12 bytes) but
numAttribs=2100. Without the fix, the reversed comparison operator (<
instead of >) would let this undersized request pass validation, and
DoChangeDrawableAttributes would iterate 2100 attribute pairs, reading
far past the 12-byte request buffer.

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-08 14:00:03 +02:00
Peter Hutterer
15cc6dfd4f pyxtest: rework the request handling to avoid to_bytes() invocations
xclient.send_request() should just take a Request object and handle
to_bytes with the right byte order. This avoids typos/copy-paste errors
in tests when the byte order changes between tests.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2216>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
745f380825 pyxtest: replace numerical error values with BadValue, etc.
Let's use human-readable variables for this.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2216>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
cf0e00596d pyxtest: document the --display option in the README
Fixes: 4d79ddd0b4 ("pyxtest: add --display for running a test against a manually started server")
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2216>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
3c21f34eeb pyxtest: fix the vidmode SwitchToModeRequest test
This test was missing SetClientVersion(2) so the reply was a the old 0.x
protocol (and the 36 byte GetModeLine reply). Update so it runs for both
versions now.

Fixes: acbc46e708 ("pyxtest: add tests for the byteswapping patches")
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2213>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
4fd0b129f4 pyxtest: require root to run the test as Xorg
This is the easiest way to notify users that it just won't run as-is.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2213>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
86b984599a pyxtest: fix xorg invocations when running from the build dir
We need a proper module tree set up so let's do this via symlinks during
the setup phase and then start the server with that as module path.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2213>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
f912223245 pyxtest: add test for present notify array byte-swap fix
The test sends a PresentPixmap request with a notify entry from a
byte-swapped client. Without the fix, the window ID in the notify
is not swapped, causing dixLookupWindow to fail with BadWindow.
With the fix, the window ID is correctly interpreted.

See 925edb6c9e ("present: Fix missing byte swaps in sproc_present_pixmap()")

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2212>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
da5ab48186 pyxtest: add test cases for the recent XKB fixes
See https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2208

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2211>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
c9f7077a77 pyxtest: add --display for running a test against a manually started server
This makes it much easier to debug an individual test since we can now
start an X server via valgrind/gdb/whatever and have the test client
connect to that server.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
6adaaf4317 pyxtest: add tests for XI property data byte-swap fix
Add tests for commit b243ef9bc2 ("Xi: Swap property data in
SProcXChangeDeviceProperty/SProcXIChangeProperty").

Both tests set a format=32 property from a byte-swapped client and
read it back, verifying the values round-trip correctly. Without the
property data swap, the stored values have the wrong byte order.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
bf37a8e785 pyxtest: add tests for the byteswapping patches
Not a full list since not all can easily be tested but hey, better than
nothing.
See https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2181

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
c2e2bf8095 pyxtest: add test cases for the Screensaver extension CVEs of the last years
Commit 6c4c530107 ("Xext: Fix out of bounds access in SProcScreenSaverSuspend()")

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
998435a4c8 byxtest: add test cases for the RECORD extension CVEs of the last years
Commit 2902b78535 ("Fix XRecordRegisterClients() Integer underflow")

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
ffdd1830e1 pyxtest: add test cases for the various XKB CVEs from the last few years
Commit 446ff2d317 ("Check SetMap request length carefully.")
Commit 6907b6ea2b ("xkb: add request length validation for XkbSetGeometry")
Commit 4cd8533210 ("xkb: Fix buffer overflow in _XkbSetCompatMap()")
Commit f7cd1276bb ("Correct bounds checking in XkbSetNames()")

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
cac197605d pyxtest: add test cases for the RandR extension CVEs of the last years
Commit 541ab2ecd4 ("Xi/randr: fix handling of PropModeAppend/Prepend")
Commit 14f480010a ("randr: avoid integer truncation in length check of ProcRRChange*Property")

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
659f759239 pyxtest: add tests for XI property and passive grab CVEs
Commit 541ab2ecd4 ("Xi/randr: fix handling of PropModeAppend/Prepend")
Commit 8f454b793e ("Xi: avoid integer truncation in length check of ProcXIChangeProperty")
Commit 51eb63b0ee ("Xi: disallow passive grabs with a detail > 255")

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Peter Hutterer
0eabe641f1 test: add pytest-based test suite
This test suite is primarily aimed at reproducing the various CVE issues
we've had over the years that require custom crafted protocol requests.
It may also be useful for other testing.

Wrapped in python because pytest is a powerful test suite runner and
writing custom buffers is easy.

The architecture is so that we fork off an X server (one or more of
Xvfb, Xwayland, Xorg) and then run our test clients against that to
check whether we get the right reply, or crash the server, or whether
valgrind complains about something (valgrind is started automatically
for tests that are marked as such).

Tests can be run manually via pytest or via meson test.

Assisted-by: Claude:claude-claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2187>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-08 14:00:03 +02:00
Jeremy Huddleston Sequoia
fa2cd7d53c rootless: Protect alpha channel for Render operations
The Render extension operates on PictFormats rather than GC, so it
bypasses the rootless layer's GC-based alpha protection
(ROOTLESS_PROTECT_ALPHA).  Depth-24 windows use PICT_x8r8g8b8 where
the 'x' tells pixman the high byte is padding it may freely zero.
The macOS compositor needs this byte to be 0xFF (opaque).

Before each Render operation that targets a rootless window,
temporarily upgrade the destination Picture's format from
PICT_x8r8g8b8 to PICT_a8r8g8b8.  This tells pixman that the alpha
channel is significant and must not be optimized away.  The format
is restored after the operation completes.

This parallels how ROOTLESS_PROTECT_ALPHA handles GC operations (by
masking alpha out of the planemask) and how ROOTLESS_SAFEALPHA
handles PaintWindow (by forcing alpha in solid fills).  The
save/restore approach is analogous to rootlessGC.c's GC_SAVE /
GC_RESTORE pattern.

Fixes [2/2]: https://github.com/XQuartz/XQuartz/issues/31

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2026-06-08 13:30:09 +02:00