Commit graph

24,083 commits

Author SHA1 Message Date
Joseph Crowell
66d3d9a170 ci: build and symbol-check the sun* drivers on sparc64
The sparc64 QEMU job installs the server, builds the six sun* drivers
from their tags and runs check-symbols.sh on each module.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 14:48:47 +10:00
Joseph Crowell
5197fe65e2 ci: don't symbol-check sun* drivers on x86
The SBUS API they use is built into the server only on SPARC, so x86
driver jobs only compile them; the sparc64 job checks them.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 14:44:34 +10:00
Joseph Crowell
3b19e38090 ci: build apm, ast and omap 25.0.1
Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 14:43:27 +10:00
Joseph Crowell
f7ca74fb6e ci: build xf86-video-intel 25.0.3
Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 14:15:21 +10:00
Joseph Crowell
0db30134e1 ci: show symbol check failures as error annotations
Each module that fails check-symbols.sh, or a driver that built none,
becomes an error annotation naming it and its missing symbols, so they
show at the top of the run and in the failure notification.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 14:01:47 +10:00
Joseph Crowell
82909ceadf ci: check-symbols: find server libraries, don't cancel driver jobs
ldd now searches the server's libdir, so libraries installed with the
server (libdrm in CI) are not reported as missing server symbols, and a
library still not found exits 2. One failing driver job no longer
cancels the others.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 13:21:53 +10:00
Joseph Crowell
5d1e5b1f11 ci: check every built driver's server symbols
Each driver job runs check-symbols.sh on the modules it built and
fails when the server does not export a symbol they need. Changes
to abi/ or the driver build script now run the driver jobs.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 13:21:53 +10:00
Joseph Crowell
89489edbe6 ci: build xf86-video-xgi 25.0.2
xgi 25.0.1 leaves r_port, w_port, Alignment and XGINew_SenseLCD
undefined, so the module cannot be loaded; 25.0.2 has the fixes.
2026-11-15 09:44:16 +10:00
Joseph Crowell
e73bc97dde abi: check-symbols: fail BIND_NOW modules that need other modules
A module linked with -z now must resolve every symbol at dlopen(),
before the modules it loads itself exist, so report the symbols only
other modules define and suggest -z lazy.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 07:28:35 +10:00
Joseph Crowell
0db2f95064 ci: run the merge conflict check only in X11Libre/xserver
On forks it tried to comment on upstream PRs with the fork's token
and failed on every push to master.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 06:30:58 +10:00
Joseph Crowell
072dcf3799 abi: check-symbols: accept an installed server prefix
With --prefix <dir>, check a module against the Xorg in <dir>/bin and
the module directory from the xorg-server.pc pkg-config finds, so CI
jobs with an installed server can run the check.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 06:24:54 +10:00
Joseph Crowell
84a7860f33 ci: build drivers on fork PRs without pushing the SDK image
A fork PR's token cannot push to ghcr.io, so build-sdk-image failed and
the driver builds were skipped. On fork PRs, pass /opt/x11 from the
built SDK image as an artifact and unpack it over the deps image.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 05:54:13 +10:00
Joseph Crowell
8fe034fa3b abi: install driver ABI check tools with the SDK
Ship the libabigail and symbol checks drivers use, so every driver can
test itself against staged servers; find them with pkg-config
--variable=abi_tools_dir xorg-server.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 04:48:56 +10:00
Joseph Crowell
9fd09f4bd9 ci: qemu: install qemu-user where qemu-user-static is gone
Ubuntu 26.04 runners have no qemu-user-static: qemu-user ships the
static binaries without the -static suffix and qemu-user-binfmt
registers them. Fall back to those and copy the registered binary.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 02:06:31 +10:00
Joseph Crowell
caf6b98e51 ci: build xf86-video-xgi 25.0.1
xgi 25.0.0 does not build with GCC 15 (C23 bool, incompatible pointer
types); 25.0.1 has the fixes.

Signed-off-by: Joseph Crowell <joseph.w.crowell@gmail.com>
2026-11-15 01:17:40 +10:00
Enrico Weigelt, metux IT consult
6736dc77d0 miext: damage: fix ABI mismatch caused by Xorg patch
The xorg commit da72833185 which had been
cherry-picked introduces a new field in the middle of the DamageRec struct,
which is part of the public driver ABI.

It broke at least the amdgpu driver (at time of writing no others known yet)

So doing what's the correct approach here: always put new fields at the
end of the struct, never change existing layout.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-11-13 17:26:38 +01:00
b-aaz
ea4abb01ae xfree86: loader: Fix memory/array bugs in loadmod.
`sizeof` was incorrectly used to get the length of an string in an array
of char pointers (array of strings), which always returns the system's
pointer size (8 on 64bit) instead of the actual string length.
Was fixed by using `strlen` instead.

Additionally the final step that appended the returning array of strings
with another array of strings, also used an incorrect `memcpy` function
to copy the elements.
Was fixed by using an explicit for loop.

And I also replaced the 'length' variables' type's with the proper
`size_t` type instead of `int`, where possible.

Issue and patch from:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299077

Signed-off-by: b-aaz <b-aazbsd@proton.me>
2026-11-13 15:31:03 +01:00
Enrico Weigelt, metux IT consult
6fc7af13d1 .github: cygwin: install python39-lxml
gen_gl_wrappers.py imports lxml.etree at build time, but Cygwin CI only
installed python312-lxml (for Python 3.12) while the default Python is
python39. Add python39-lxml so the import succeeds under Cygwin.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-11-10 10:22:48 +01:00
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