Commit graph

24,065 commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
ee4bb3f96e xfree86: int10: remove unused/obsolete dprint()
Not used anymore, so no need to keep it around any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-11-02 14:16:03 +01:00
Enrico Weigelt, metux IT consult
63379b4871 xfree86: int10: drop never used SHOW_ALL_DEVICES code pathes
These code pathes have never been actually used, thus no need to
carry them around for any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-11-02 14:14:20 +01:00
Enrico Weigelt, metux IT consult
483a1722f9 xfree86: int10: drop obsolete vm86 backend
* didn't compile since 2014 (commit 21b216ad6)
* based on vm86(), which is only availble on Linux i386/i686
* obsoleted by x86emu

Thus no need to carry around broken code pathes any longer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-27 18:11:33 +01:00
Enrico Weigelt, metux IT consult
2545199fd8 xfree86: int10: remove some unused defines
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-27 17:23:31 +01:00
Enrico Weigelt, metux IT consult
07fa547b67 xfree86: int10: drop ancient remains of some DX/UX workaround
It seems that ancient DG/UX systems needed some special workarounds,
which of we only have some remains left that are never compiled.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-27 17:19:21 +01:00
Enrico Weigelt, metux IT consult
146a76a6c1 xfree86: int10: add define X86_CARRY_MASK
add a define with proper name instead of using raw literal value.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-27 16:43:25 +01:00
Enrico Weigelt, metux IT consult
722929bf50 xfre86: int10: drop obsolete REG macro definition
Not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-27 16:04:55 +01:00
Enrico Weigelt, metux IT consult
809696d4ee xfree86: int10: drop mode dead code
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-27 15:22:07 +01:00
Enrico Weigelt, metux IT consult
2ebd277a6d xfree86: drop some dead code
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-27 12:33:38 +01:00
Peter Hutterer
a8192aa709 Xi: add bounds check for barrier events in input_constrain_cursor
input_constrain_cursor() writes barrier hit and leave events into the
InputEventList buffer without checking how many slots remain.
The buffer is allocated by the DDX at GetMaximumEventsNum() (100) entries
and may contain one raw event already. A client can create more than 100
pointer barriers, pre-arm them as released via XIBarrierReleasePointer,
and then trigger a single pointer motion that crosses all barriers
simultaneously. The leave event loop iterates every hit barrier and
writes one event per barrier, overflowing the 100-slot buffer.

In an ideal world we'd change the InternalEvent* pointer to a struct
that contains allocated size, number of events and the pointer itself
but we're crossing public APIs here and that requires an ABI bump.

So we make do with cutting off the number of barrier events at 64 which
should be low enough to not trigger the issue. However, for the 100+
barrier case this means we only send BarierHit events, not BarrierRelease.
Potentially leaving a client stuck.

We mitigate that problem by simply refusing to create more than 32
barriers per screen (which on its own would also fix the issue, but hey,
'doppelt gemoppelt' as they say).

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

ZDI-CAN-31938

CVE-2026-93519

Assisted-by: Claude:claude-opus-4-6
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2341>
(cherry picked from commit 1f42cc1f00)
2026-10-20 21:11:11 +02:00
Peter Hutterer
4cec8f8089 dix: remove passive grabs referencing a device on removal
Passive grabs (GrabRec) store raw DeviceIntPtr values for both the
grabbed device and the modifier device without any lifetime management.
When a device is removed via XIRemoveMaster, CloseDevice() frees the
device struct, but leaves dangling pointers in grab->modifierDevice
for any grab that used this device.

Subsequent pointer events trigger CheckPassiveGrab() which dereferences
the dangling modifierDevice pointer for XI grabs (the CORE and XI2 paths
reassign it, but the XI path does not).

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

ZDI-CAN-31832

CVE-2026-93516

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2341>
(cherry picked from commit be57263415)
2026-10-20 21:11:11 +02:00
Peter Hutterer
cede1a7f95 Xi: validate modifier values in ProcXIPassiveUngrabDevice
ProcXIPassiveUngrabDevice() passes client-supplied modifier values
directly to DeletePassiveGrabFromList() without validating them.

DeletePassiveGrabFromList() may reach DeleteDetailFromMask() which uses
BITCLEAR(mask, modifier). The mask is allocated as 8 Mask words (256
bits). A modifier value > 255 causes BITCLEAR to index mask[modifier>>5]
past the allocation, resulting in a controlled single-bit-clear at an
attacker-chosen heap offset.

Add the same modifier validation that CheckGrabValues() uses: reject
modifiers that are not XIAnyModifier and have bits set outside
AllModifiersMask.

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

ZDI-CAN-32366

CVE-2026-93523

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2341>
(cherry picked from commit 37a1847a60)
2026-10-20 21:11:11 +02:00
Mario Kleiner
81e6f606a1 modesetting: Fix RandR output leasing while TearFree is enabled.
Since commit a94dd9536 ("modesetting: add support for TearFree page flips"),
whenever TearFree and PageFlip is simultaneously enabled (which is the
default now), the driver does enable DRM universal plane support, just
as when atomic modesetting is enabled.

Leasing RandR / DRM outputs with universal planes enabled requires
also adding the drm_plane object to the set of leased objects,
otherwise the drmModeCreateLease() ioctl will fail.

Adding a drm_plane object under this condition was omitted, so fix
this omission, and thereby fix RandR output leasing.

Fixes: a94dd9536 ("modesetting: add support for TearFree page flips")
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2332>
(cherry picked from commit f37bd8de26)
2026-10-20 19:58:05 +02:00
Peter Hutterer
9e3b288abf Fix remaining ruff check issues
Two if conditions compressed into one.
Two open() marked as ignored by SIM115 (use context manager for opening files)
because it'd require too much restructuring.
And one open() ... close()  changed to a context manager, the diff
is the reindentation of everything between open and close.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2327>
(cherry picked from commit eb9292efdb)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2026-10-20 19:56:53 +02:00
Peter Hutterer
d6de666503 Ruff check --fix --unsafe-fixes across the tree
Only affecting two files and these are the straightforward changes.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2327>
(cherry picked from commit 2c53e65004)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2026-10-20 19:56:53 +02:00
Peter Hutterer
c3b028aee8 Run ruff format against the whole source tree
Only two files that needed changes anyway, might as well enforce this.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2327>
(cherry picked from commit 6aa23cf642)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2026-10-20 19:56:53 +02:00
Peter Hutterer
51b140b4ad config: remove the fdi2iclass.py script
This is still Python2 which has been EOL for many moons now. The script
dates back to 2010 and we've well and truly moved on from using fdi files
to using xorg.conf snippets.

If in the last 16 years you somehow didn't manage to port the fdi
snippets, the git history will provide you with this file on request.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2327>
(cherry picked from commit f8af92cac4)
2026-10-20 19:56:53 +02:00
Peter Hutterer
bae088ccbd xkb: fix CheckKeySyms overwriting request-range symsPerKey entries
CheckKeySyms() has two loops: the first processes keys in the SetMap
request range, the second fills in any missing keys from the existing
map.

The indexing between the two was inconsistent: the first loop
uses a zero-based index + req->firstKeySym, the second loop used it just
as zero-based index.

Example:
   req->firstKeySym = 50
   req->nKeySyms = 10

  i goes from 0 to 10,
  loop 1 checks [50, 60), changes the width but finishes with i at 10.
  loop 2 then runs over [10, 255(, copying the old keymap width

The second loop overwrites the new widths with the width of the
existing keymap. The subsequent SetKeySyms worked on the new width
and may write fewer actions than the map width.

A subsequent XkbGetMap request would then read XkbKeyNumActions()
entries (derived from the new wider key_sym_map.width) from the shorter
action allocation, causing an out-of-bounds heap read. The overread
bytes would be copied into the GetMap reply and sent back to the client,
producing a bounded heap information disclosure.

This vulnerability was discovered by:
  WONJOON HWANG (@joon1337) working with TrendAI Zero Day Initiative

ZDI-CAN-32408

CVE-2026-93524

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2341>
(cherry picked from commit cea71d0273)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2026-10-20 19:54:36 +02:00
Peter Hutterer
c5247a4185 xkb: widen size_syms, num_syms, size_acts, num_acts to unsigned int
Fields in XkbClientMapRec and XkbServerMapRec that denote size/num
and are unsigned short can result in truncations. For example
when XkbResizeKeyType() computes the new size_syms value as
(nTotal * 15) / 10, the result may be implicitly truncated to 16
bits on assignment. This causes an undersized calloc allocation, and the
subsequent copy loop writes based on the actual (untruncated) key count,
resulting in a heap buffer overflow. A similar truncation may happen
in XkbResizeKeySyms() and XkbResizeKeyActions().

Widen the fields from unsigned short to unsigned int. These are internal
server structures, not wire protocol types.

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

ZDI-CAN-31834

CVE-2026-93518

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 89101a6c66)
2026-10-20 19:54:36 +02:00
Peter Hutterer
2822958bbf xkb: allocate names->keys to MAP_LENGTH in XkbAllocNames
Commit a3171732d ("xkb: Always use MAP_LENGTH keymap size") converted
most XKB allocation functions to use MAP_LENGTH (256) instead of
max_key_code + 1. It also removed the per-array reallocarray() calls in
XkbChangeKeycodeRange(), replacing them with a memset up to MAP_LENGTH.
However, XkbAllocNames() was missed and still allocates names->keys to
max_key_code + 1.

When a keycodes component with max_key_code < 255 is loaded (e.g.
sun(type6) with max_key_code=132) and then a SetMap request extends
maxKeyCode to 255, XkbChangeKeycodeRange() memsets names->keys from
max_key_code to MAP_LENGTH-1, writing past the undersized allocation.

Fix by allocating names->keys to MAP_LENGTH, consistent with all other
keymap arrays after a3171732d.

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

ZDI-CAN-31941

CVE-2026-93520

Fixes: a3171732da ("xkb: Always use MAP_LENGTH keymap size")

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 b941a473e0)
2026-10-20 19:54:36 +02:00
Peter Hutterer
a0f5e66caa xkb: NULL text pointer after free in _CheckSetDoodad error path
_CheckSetDoodad() allocates doodad->text.text via _GetCountedString()
and then attempts to allocate doodad->text.font. If the font string
allocation fails (e.g. because the font string length extends past
the request boundary), the error handler frees doodad->text.text but
does not NULL the pointer. The doodad was already added to the geometry
by XkbAddGeomDoodad() before the string allocations, so when
XkbFreeGeometry() runs cleanup, _XkbClearDoodad() frees the same
dangling pointer again, resulting in a double-free.

NULL the pointer after freeing it to prevent the double-free.

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

ZDI-CAN-31221

CVE-2026-88812

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 0d1b1b0bad)
2026-10-20 19:54:36 +02:00
Mikhail Dmitrichenko
37f43dc86a xkb: reject incomplete keymaps in GetKbdByName
XkmReadFile() allocates an XkbDesc before it reads the individual XKM
sections, so a section read failure leaves a non-NULL but only partially
initialized description behind.

ReadXkmKeyTypes() does not report such a failure at all. When
XkbAllocClientMap() fails it returns the number of bytes read so far,
which is positive, so XkmReadFile() takes the section for successfully
read and clears it from the mask of sections it reports as missing.

ProcXkbGetKbdByName() in turn only checks that the description it got
back is non-NULL before setting rep.loaded. It can therefore install a
description that has neither a client map nor controls, and
XkbCopyControls() then dereferences those and crashes the server.

Return -1 from ReadXkmKeyTypes() when the client map cannot be
allocated, and only report a keymap as loaded once rep.found covers
every component in fneed. Decide whether to update the actions from
rep.loaded rather than from the requested load flag, so that an
incomplete description is not handled as a successfully loaded map.

The keymap the device already had stays active when the compiled XKM
cannot be read completely.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2304>
(cherry picked from commit 6a4fb12019)
2026-10-20 19:51:15 +02:00
Mikhail Dmitrichenko
3bb0f25410 xkb: use ssize_t for XKM byte counts
The ReadXkm* section readers return the number of bytes they consumed,
or -1 when they give up. That contract was spelled as int, while the
counters accumulating their results were a mix of int and unsigned, and
XkmGetCARD8/16/32() took the counter by reference as an int *.

XkmReadFile() also returns an unsigned, but that value is a bitmask of
the sections it could not read, not a byte count. Keeping byte counts in
unsigned variables right next to it makes the two easy to confuse, and
the confusion has a concrete cost: XkmReadFile() kept the readers'
results in an unsigned tmp, so the -1 that every one of the seven
readers it dispatches to can return became UINT_MAX. That passed the
tmp > 0 test below, and the section which had just failed to read was
marked as defined and cleared from the mask of sections reported as
missing.

Use ssize_t, the usual type for "a number of bytes, or -1 on failure",
for every byte count in this file: the section readers' return type, the
local counters, the counter XkmGetCARD8/16/32() take by reference, and
the return values of XkmSkipPadding() and XkmGetCountedString(). An
unsigned in this file now only ever denotes a bitmask, and a failing
section reader is no longer taken for a successful one.

ReadXkmKeyTypes() used a single tmp both for byte counts and as the
in/out element count handed to XkmInsureTypedSize(), which needs an
int *. That second use gets its own variable.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2304>
(cherry picked from commit bad7edcab0)
2026-10-20 19:51:15 +02:00
Peter Hutterer
edfab509bd glamor: size tmp_bits buffer for source coordinate range in upload_boxes
glamor_upload_boxes() allocates the tmp_bits buffer (used for 24-bit to
32-bit depth conversion) based on the destination pixmap height, but
indexes it using source coordinates (y1 - dy_dst + dy_src). When the
source is taller than the destination, the source-relative offset
exceeds the destination height, causing writes past the buffer end.

Size the buffer to account for the source coordinate mapping:
byte_stride * (pixmap->drawable.height - dy_dst + dy_src). This
ensures the buffer covers the full range of source rows that will be
accessed during the upload.

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

ZDI-CAN-32361

CVE-2026-93522

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 ad26c26bf7)
2026-10-20 19:49:20 +02:00
Peter Hutterer
5d3b8520ec present: unlink notifies from window list in present_clear_window_notifies
When a window is destroyed, present_clear_window_notifies()
does not remove the notify list node from the window. The notify
may then be freed as part of the window_priv, leaving dangling
pointers in place.

When the vblank owning the notify is later torn down,
present_free_window_notify() calls xorg_list_del() which
writes through these dangling pointers (use-after-free write).

This happens when Present cross-window notifies are used: a
PresentPixmap on window A can reference window B as a notify target.
An untriggered wait_fence keeps the vblank alive so that B can be
destroyed first, creating the dangling-pointer window.

Fix this by calling the free function we have (and moving the window
reset into that function too). present_clear_window_notifies is only
called from one place anyway.

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

ZDI-CAN-31830

CVE-2026-93515

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 1b6955c310)
2026-10-20 19:49:20 +02:00
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
Olivier Fourdan
84d53bf2f0 miext/sync: Handle SIGBUS from truncated shm fences
A client can truncate the shared memory backing a DRI3/xshmfence sync
fence and cause SIGBUS when the server accesses it.

Register the mapping with busfault and wrap xshmfence accesses with
sigsetjmp so truncation unwinds safely, then discard the mapping while
keeping the fence XID.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Assisted-by: AI
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/work_items/1911
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2270>
(cherry picked from commit cd083d9659)
2026-10-20 19:47:40 +02:00
Olivier Fourdan
e4b68f9248 os: Add busfault_set_jmp() for SIGBUS unwind
Allow callers to arm a sigjmp_buf on a registered mapping so the
SIGBUS handler can siglongjmp instead of remapping and retrying the
faulting instruction.

Needed when the mapping contains objects that are unsafe to resume
on after a replace.

This is preparation work for the next commit where that mechanism is
used.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Assisted-by: AI
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2270>
(cherry picked from commit 7a0b3e2197)
2026-10-20 19:47:40 +02:00
Peter Hutterer
5fd95d2754 pyxtest: abstract the present xclients
Use the same fixture style as we do for other extensions.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2325>
(cherry picked from commit cd79f876b1)

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2026-10-20 19:46:28 +02:00
Kevin.Li
2fb3d5391c glamor: use highp for fill_pos UVs on GLES
Problem:
On a 2K (e.g. 2560x1440) display, WPS Office for Linux (Qt) shows
corrupted text and broken vertical lines on the right side of a
maximized window when the UI is updated by mouse movement (e.g.
hover/scroll refreshing labels). The same controls on the left side
are fine. The issue does not appear at 1080p, without glamor, or when
using desktop OpenGL shaders (non-GLES).

Root cause:
Xwayland GBM n-buffering CopyArea's window pixmap into the present
pixmap via glamor_copy (FBO texture blit). UVs are computed as
(offset + pixel) * (1/width, 1/height). GLES fragment shaders default
to mediump (~10-bit relative precision), so on wide pixmaps UVs near
the right edge can be off by about a pixel; with GL_NEAREST this
shows as shifted/broken glyphs and edges. Desktop OpenGL has no
default mediump precision qualifier, so the same shader path is fine.

Fix:
Force highp only on fillpos uniforms/ins/outs. Keep the global
mediump default for other fragment math.

Change-Id: If747516bdf787e0383b42e3579acfeab30a7cb1c
Signed-off-by: Kevin.Li <kevin.li@cixtech.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2315>
(cherry picked from commit 2b9ce9f6c6)
2026-10-20 19:46:16 +02:00
Kiyoshi Spreclerg
3a7005b67c composite: fix inverted cw->damaged in compReportDamage()
Also use `false` instead of `FALSE` in compWindowUpdate() for the bool field.

Fixes: 4a30260387 ("composite: use 'bool' instead of 'Bool' in CompClientWindowRec")
Signed-off-by: Kiyoshi Spreclerg <kiyoshi_pip@protonmail.com>
2026-10-19 13:10:03 +02:00
stefan11111
29a6b17197 kdrive/modesetting: pass the gbm device to glamor
Don't have it open another one

This fixes a segfault when the render card is different from
the scanout card, and glamor uses the fast gbm import path.

If https://github.com/X11Libre/xserver/issues/2645
applies to Xmodesetting, this probably fixes it.

This is also a resource usage optimization,
since glamor doesn't allocate another gbm device
when Xmodesetting already allocates a perfectly usable one.

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-10-19 13:09:25 +02:00
stefan11111
fbde8700f8 glamor/glamor_egl: Add support for passing gbm devices to glamor
Instead of having glamor_egl create the gbm device, let the ddx create
it and pass it to glamor.

This allows for saving some resources and for fixing a
bug on amd (if it still happens)

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
2026-10-19 13:09:25 +02:00
Enrico Weigelt, metux IT consult
d13cf6f431 Xext: xv: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-17 19:45:49 +02:00
Enrico Weigelt, metux IT consult
c255120ee8 Xext: saver: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-17 19:37:55 +02:00
Enrico Weigelt, metux IT consult
fa10100eea test/pyxtest: keep parallel servers from taking over each other's display
Each test starts its own X server via -displayfd, and pytest-xdist runs
several workers (meson several suites) in parallel.  Servers scanning for a
free display number at the same time can both end up claiming the same one:
the losing test's client then connects to the winner's server, and when the
winner is torn down at the end of its own test the loser's connection dies
mid-test.  It surfaces as an opaque

    BrokenPipeError: [Errno 32] Broken pipe
    test/pyxtest/xclient.py:270: in send_request / self.sock.sendall(data)

in an unrelated test, which looks like a flake and hides the cause.

Hold a cross-process lock for the short display-allocation window (Popen
plus reading the display number).  Once a server has announced its display
it owns the socket and the lock file, so later servers skip that number and
that window is the only place the race can happen.

As a safety net, record the server PID that owns the socket (SO_PEERCRED)
and fail the xclient fixture with a clear message when it is not the server
the fixture started, instead of leaving a confusing BrokenPipeError.

Measured with a --buildtype=debug build and 4 pytest-xdist workers, 40
parallel pytest sessions of test_xi.py: before, 7 sessions failed with
"connected to PID X instead of the test server" and 5 with
BrokenPipeError; after, 0 of 40, plus 0 errors over 8 full test/pyxtest
runs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-16 14:50:03 +02:00
Enrico Weigelt, metux IT consult
7289b9936c test/info: run display-info tests serialised to avoid display-number race
The xvfb / xehypr / xehypr-glamor display-info tests each start their own X
server (Xvfb, or Xephyr nested inside Xvfb) via simple-xinit -displayfd. When
several of them start at the same instant, the servers race on the same display
numbers and the losing client ends up with a display it cannot open, failing the
lane intermittently:

  _XSERVTransSocketUNIXCreateListener: /tmp/.X11-unix/X0 already in use
  _XSERVTransMakeAllCOTSServerListeners: server already running
  xdpyinfo: unable to open display ":1".

This reproduces on master (run 38774811861) as well as on PRs, hitting a
different display-info subtest each time, so it is a harness race and not a
regression in the code under test. Mark these tests is_parallel:false so the
display allocation cannot collide. The tests are short, so the lost parallelism
is negligible.

Test-harness only, no production code change.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-16 14:08:52 +02:00
Enrico Weigelt, metux IT consult
f9a4cc731a Xext: shm: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-16 11:59:20 +02:00
Enrico Weigelt, metux IT consult
66505eecd5 Xext: sync: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-15 19:08:16 +02:00
Enrico Weigelt, metux IT consult
4fb08174d7 Xext: shape: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-15 17:57:49 +02:00
Enrico Weigelt, metux IT consult
e1aa7c5fd5 Xext: randr: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-15 17:30:45 +02:00
Enrico Weigelt, metux IT consult
e0c0a20dee Xext: damage: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-15 17:30:26 +02:00
Enrico Weigelt, metux IT consult
06775174d1 Xext: xfixes: fix mismatching event swap prototypes
Instead of hard typecasts on event proc assignment, better accept the
expected parameter types and do the typecast inside the functions.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-15 17:28:32 +02:00
Enrico Weigelt, metux IT consult
d7acb8153d dix: replace global swapEvent buffer with per-call calloc/free
The global static swapEvent/swapEventLen buffer in WriteEventsToClient()
was a persistent allocation that grew on demand. Replace with a
per-call calloc/free to avoid holding memory indefinitely and to
eliminate a static state that is not thread-safe.

The previous logic grew the buffer via realloc() and kept it for the
life of the process. The new logic allocates exactly eventlength bytes
for each swapped WriteEventsToClient() call, uses it for all events
in that call, and frees it before returning.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-15 17:11:55 +02:00
Herman Semenoff
01ac17b4c7 dix, Xi: remove spurious dereference when checking function pointers
Check CursorConfinedTo and CursorWarpedTo function pointers directly without
dereferencing them in 'if' conditions in events and xiwarppointer

Signed-off-by: Herman Semenoff <GermanAizek@yandex.ru>
2026-10-15 16:47:45 +02:00
Enrico Weigelt, metux IT consult
dd3082b1ae ci: fix purge script — preserve PR runs for open PRs (including forks)
The purge script was deleting workflow runs for PRs from forks because it
only checked branch existence in the main repo (X11Libre/xserver). Fork PR
branches don't exist there, so their runs were deleted immediately.

Fix: fetch the 'pull_requests' field from the workflow run API and skip
deletion if any associated PR is still open. Also fetch head_repository
for logging.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-14 18:18:05 +02:00
Enrico Weigelt, metux IT consult
a6710636a1 xfree86: remove $XORGCONFIG environment variable
It's just an ancient relic from previous century, that's ever been helpful
in a few corner cases - and can be easily replaced by -config / -configdir
cmdline options.

OTOH, it's a potential security risk for Xservers running with suid root
(eg. if it somehow fails to detect/switch to the restricted mode)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-14 18:01:00 +02:00
Mason Green
a5e0681f65 dix/window: fix UnmapNotify and DestroyNotify order in DestroySubwindows
The X11 protocol requires each window to be destroyed in turn.
Previously, DestroySubwindows unmapped all child windows first.
This sent all UnmapNotify events before any DestroyNotify events.
Removing the UnmapSubwindows call lets each child window be unmapped
and destroyed individually. This restores correct event ordering.

Each child now runs its own ValidateTree pass instead of sharing one.
This diverges from xorg/main, which still carries the UnmapSubwindows
shortcut and its XXX comment.

Signed-off-by: Mason Green <mason@greenm01.net>
2026-10-14 18:00:21 +02:00
David
c5453462ea dix: stop animated cursors before freeing device sprites
Signed-off-by: David <david@code.contractors>
2026-10-14 17:04:26 +02:00
Enrico Weigelt, metux IT consult
2652994e8b ci: decouple apt cache — build jobs only pull, separate job pushes
- Build jobs (ubuntu-install-pkg): use actions/cache/restore@v5 with fail-on-cache-miss=false
  → optional warm cache, no failure on miss, no write-back (no locking conflicts)

- New action ubuntu-save-apt-cache: actions/cache/save@v5 with global key
  → only this action writes the cache

- New workflow ubuntu-apt-cache.yml: daily 02:00 UTC + master push
  → proactively populates global apt cache

- Removed ubuntu-fetch-pkg job and all needs: ubuntu-fetch-pkg dependencies
  → build jobs run independently, no chain delay causing cache TTL expiry

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-10-14 15:24:09 +02:00