Commit Graph

20969 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
c077d814a3 hotfix release xlibre-xserver-25.0.0.16
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xserver-25.0.0.16
2025-11-20 11:02:35 +01:00
stefan11111
6d7a820a45 xfree86: loader: warn when implicitly ignoring abi mismatch
for the nvidia proprietary DDX driver

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-19 13:33:32 +01:00
stefan11111
8522803f8c xfree86: loader: simplify setting IgnoreABI option
IgnoreABI option is kept in a single bit of an unsigned long variable
LoaderOptions that has no other use.

This patch replaces it with a variable named LoaderIgnoreAbi
and a proc for setting it.

Inspired by b61b35a0b3

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-19 13:33:32 +01:00
stefan11111
3df2ae1c9e xfree86: loader: Ignore abi mismatch for the proprietary nvidia DDX
This is a proprietary DDX driver made by nvidia.
We can't rebuild it against Xlibre, so the abi check would always fail.

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-19 13:33:32 +01:00
stefan11111
7f575ddc99 modesetting: Fix leak when disabling hw cursor
Backport from https://github.com/X11Libre/xserver/pull/1370

Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-11-14 12:30:12 +01:00
Enrico Weigelt, metux IT consult
0c507fbcce hotfix release xlibre-xserver-25.0.0.15
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xserver-25.0.0.15
2025-11-13 19:30:35 +01:00
Tautvis
7fa05a8760 modesetting: call xf86_cursors_fini during CloseScreen
Add matching call for xf86_cursors_init to clean memory, as during
initialization it allocates memory (depends, but is something like ~256Kb)
and it leaks when XServer resets.

Signed-off-by: Tautvis <gtautvis@gmail.com>
2025-11-13 16:06:51 +01:00
Enrico Weigelt, metux IT consult
3dbeda9909 xfree86: compat: re-add GEInitEvent() for proprietary nvidia driver
Yet another very internal function that the proprietary Nvidia driver
is using for unknown reasons. NVidia really needs a separate function
for just for some trivial struct initialization and don't manage to
add three simple lines to their code, so we have to make an extra
function for them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-31 16:50:36 +01:00
Enrico Weigelt, metux IT consult
169f912b5b xfree86: compat: re-add TimeCheck() for proprietary nvidia driver
Yet another very internal function that the proprietary Nvidia driver
is using for unknown reasons.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-31 16:50:36 +01:00
Enrico Weigelt, metux IT consult
122d5b9130 hotfix release xlibre-xserver-25.0.0.14
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xserver-25.0.0.14
2025-10-30 13:13:06 +01:00
Olivier Fourdan
3d886958e6 xkb: Prevent overflow in XkbSetCompatMap()
The XkbCompatMap structure stores its "num_si" and "size_si" fields
using an unsigned short.

However, the function _XkbSetCompatMap() will store the sum of the
input data "firstSI" and "nSI" in both XkbCompatMap's "num_si" and
"size_si" without first checking if the sum overflows the maximum
unsigned short value, leading to a possible overflow.

To avoid the issue, check whether the sum does not exceed the maximum
unsigned short value, or return a "BadValue" error otherwise.

CVE-2025-62231, ZDI-CAN-27560

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2086>
2025-10-30 13:11:35 +01:00
Olivier Fourdan
0e1a023be5 xkb: Free the XKB resource when freeing XkbInterest
XkbRemoveResourceClient() would free the XkbInterest data associated
with the device, but not the resource associated with it.

As a result, when the client terminates, the resource delete function
gets called and accesses already freed memory:

 | Invalid read of size 8
 |   at 0x5BC0C0: XkbRemoveResourceClient (xkbEvents.c:1047)
 |   by 0x5B3391: XkbClientGone (xkb.c:7094)
 |   by 0x4DF138: doFreeResource (resource.c:890)
 |   by 0x4DFB50: FreeClientResources (resource.c:1156)
 |   by 0x4A9A59: CloseDownClient (dispatch.c:3550)
 |   by 0x5E0A53: ClientReady (connection.c:601)
 |   by 0x5E4FEF: ospoll_wait (ospoll.c:657)
 |   by 0x5DC834: WaitForSomething (WaitFor.c:206)
 |   by 0x4A1BA5: Dispatch (dispatch.c:491)
 |   by 0x4B0070: dix_main (main.c:277)
 |   by 0x4285E7: main (stubmain.c:34)
 | Address 0x1893e278 is 184 bytes inside a block of size 928 free'd
 |   at 0x4842E43: free (vg_replace_malloc.c:989)
 |   by 0x49C1A6: CloseDevice (devices.c:1067)
 |   by 0x49C522: CloseOneDevice (devices.c:1193)
 |   by 0x49C6E4: RemoveDevice (devices.c:1244)
 |   by 0x5873D4: remove_master (xichangehierarchy.c:348)
 |   by 0x587921: ProcXIChangeHierarchy (xichangehierarchy.c:504)
 |   by 0x579BF1: ProcIDispatch (extinit.c:390)
 |   by 0x4A1D85: Dispatch (dispatch.c:551)
 |   by 0x4B0070: dix_main (main.c:277)
 |   by 0x4285E7: main (stubmain.c:34)
 | Block was alloc'd at
 |   at 0x48473F3: calloc (vg_replace_malloc.c:1675)
 |   by 0x49A118: AddInputDevice (devices.c:262)
 |   by 0x4A0E58: AllocDevicePair (devices.c:2846)
 |   by 0x5866EE: add_master (xichangehierarchy.c:153)
 |   by 0x5878C2: ProcXIChangeHierarchy (xichangehierarchy.c:493)
 |   by 0x579BF1: ProcIDispatch (extinit.c:390)
 |   by 0x4A1D85: Dispatch (dispatch.c:551)
 |   by 0x4B0070: dix_main (main.c:277)
 |   by 0x4285E7: main (stubmain.c:34)

To avoid that issue, make sure to free the resources when freeing the
device XkbInterest data.

CVE-2025-62230, ZDI-CAN-27545

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2086>
2025-10-30 13:11:35 +01:00
Olivier Fourdan
0fe98da5f5 xkb: Make the RT_XKBCLIENT resource private
Currently, the resource in only available to the xkb.c source file.

In preparation for the next commit, to be able to free the resources
from XkbRemoveResourceClient(), make that variable private instead.

This is related to:

CVE-2025-62230, ZDI-CAN-27545

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2086>
2025-10-30 13:11:35 +01:00
Olivier Fourdan
e2cd802a73 present: Fix use-after-free in present_create_notifies()
Using the Present extension, if an error occurs while processing and
adding the notifications after presenting a pixmap, the function
present_create_notifies() will clean up and remove the notifications
it added.

However, there are two different code paths that can lead to an error
creating the notify, one being before the notify is being added to the
list, and another one after the notify is added.

When the error occurs before it's been added, it removes the elements up
to the last added element, instead of the actual number of elements
which were added.

As a result, in case of error, as with an invalid window for example, it
leaves a dangling pointer to the last element, leading to a use after
free case later:

 |  Invalid write of size 8
 |     at 0x5361D5: present_clear_window_notifies (present_notify.c:42)
 |     by 0x534A56: present_destroy_window (present_screen.c:107)
 |     by 0x41E441: xwl_destroy_window (xwayland-window.c:1959)
 |     by 0x4F9EC9: compDestroyWindow (compwindow.c:622)
 |     by 0x51EAC4: damageDestroyWindow (damage.c:1592)
 |     by 0x4FDC29: DbeDestroyWindow (dbe.c:1291)
 |     by 0x4EAC55: FreeWindowResources (window.c:1023)
 |     by 0x4EAF59: DeleteWindow (window.c:1091)
 |     by 0x4DE59A: doFreeResource (resource.c:890)
 |     by 0x4DEFB2: FreeClientResources (resource.c:1156)
 |     by 0x4A9AFB: CloseDownClient (dispatch.c:3567)
 |     by 0x5DCC78: ClientReady (connection.c:603)
 |   Address 0x16126200 is 16 bytes inside a block of size 2,048 free'd
 |     at 0x4841E43: free (vg_replace_malloc.c:989)
 |     by 0x5363DD: present_destroy_notifies (present_notify.c:111)
 |     by 0x53638D: present_create_notifies (present_notify.c:100)
 |     by 0x5368E9: proc_present_pixmap_common (present_request.c:164)
 |     by 0x536A7D: proc_present_pixmap (present_request.c:189)
 |     by 0x536FA9: proc_present_dispatch (present_request.c:337)
 |     by 0x4A1E4E: Dispatch (dispatch.c:561)
 |     by 0x4B00F1: dix_main (main.c:284)
 |     by 0x42879D: main (stubmain.c:34)
 |   Block was alloc'd at
 |     at 0x48463F3: calloc (vg_replace_malloc.c:1675)
 |     by 0x5362A1: present_create_notifies (present_notify.c:81)
 |     by 0x5368E9: proc_present_pixmap_common (present_request.c:164)
 |     by 0x536A7D: proc_present_pixmap (present_request.c:189)
 |     by 0x536FA9: proc_present_dispatch (present_request.c:337)
 |     by 0x4A1E4E: Dispatch (dispatch.c:561)
 |     by 0x4B00F1: dix_main (main.c:284)
 |     by 0x42879D: main (stubmain.c:34)

To fix the issue, count and remove the actual number of notify elements
added in case of error.

CVE-2025-62229, ZDI-CAN-27238

This vulnerability was discovered by:
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2086>
2025-10-30 13:11:35 +01:00
Tautvis
c329f4e91c dix: dixFreeScreen call hookPostCreateResources too
Call DeleteCallbackList(&pScreen->hookPostCreateResources) during
dixFreeScreen, because otherwise it will be heap-use-after-free during
DeleteCallbackManager call.

Signed-off-by: Tautvis <gtautvis@gmail.com>
2025-10-29 16:28:33 +01:00
Enrico Weigelt, metux IT consult
e422cfc73c hotfix release xlibre-xserver-25.0.0.13
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xserver-25.0.0.13
2025-10-28 19:55:50 +01:00
Alan Coopersmith
edd022b5ec xfree86: add missing headers to build sun_init.c on Solaris/SPARC
Fixes: 0f715b4 ("xfree86: os-support: move hidden Solaris-specific symbols out of public header")
Fixes: e2fa0d2 ("fix including <sys/mman.h>")

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>

Further explanation about this commit by @alanc:

This particular set of `#ifdefs` matches the ones around the code using the fbio ioctls and mmap calls in the `xf86CloseConsole()` code later in the file:
c62cd2feaa/hw/xfree86/os-support/solaris/sun_init.c (L281)
reflecting the lack of /dev/fb style drivers on x86 systems on Solaris.
2025-10-21 13:52:48 +02:00
Alan Coopersmith
73fbf6b645 xfree86: Fix -Wdiscarded-qualifiers warnings in SPARC Sbus probe code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-21 13:52:48 +02:00
Alan Coopersmith
68cb3407d5 xfree86: fix meson build on 64-bit Solaris/SPARC systems
For cpu_family(), meson returns "sparc" for 32-bit sparc,
and "sparc64" for 64-bit sparc, regardless of the OS in use.

For cpu(), meson returns values like "sun4v" on Solaris/SPARC,
and doesn't promise stability of the values, or portability across
OS'es, unlike cpu_family().

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2070>
2025-10-21 13:52:48 +02:00
Enrico Weigelt, metux IT consult
6f3a4caf97 xfree86: xv: fix missed hooking of WindowDestroy
Forgot to register window destroy hook - that's leading to crash:

    https://github.com/X11Libre/xserver/issues/959

Fixes: b60581e393
Bug: https://github.com/X11Libre/xserver/issues/959
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 17:08:41 +02:00
Enrico Weigelt, metux IT consult
56b47805a5 bugfix release 25.0.0.12
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xserver-25.0.0.12
2025-09-26 16:59:58 +02:00
Enrico Weigelt, metux IT consult
e3b0007db1 Xext: namespace: fix NULL derefence on client close
Removing the namespace assignment of killed clients in ClientState-hook
is too early - we still need it later. Using the new ClientDestroyCallback
instead.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 16:49:51 +02:00
Enrico Weigelt, metux IT consult
bc53cfa275 dix: add callback before ClientRec is being destroyed
Existing client-state hook isn't sufficient for this, and so easy to
be extended cleanly (*1). Adding a new callback is trivial and cheap,
so preferring this way, instead of trying to tweak the existing hook
for something it's never been designed for.

*1) see discussion here: https://github.com/X11Libre/xserver/pull/1077

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 16:49:51 +02:00
Enrico Weigelt, metux IT consult
19527ac905 render: fix missing include in glyphstr.h
Need to include renderproto.h

Closes: https://github.com/X11Libre/xserver/issues/700
Reported-By: Kevin Kofler <kevin@tigcc.ticalc.org>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 16:45:33 +02:00
Enrico Weigelt, metux IT consult
536719a49d .github: use our own mirrors of build dependencies
f.d.o is failing too often in recent times, so switching to our
own mirrors at github.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-18 10:27:55 +02:00
Enrico Weigelt, metux IT consult
12bc7c4988 glx: fix wrong swapped encoding in __glXDisp_QueryExtensionsString()
The name string is supposed to be transmitted as-is, not swapped in
4-byte chunks.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 11:51:17 +02:00
Enrico Weigelt, metux IT consult
a358ff66fc .github: ubuntu: drop xtrans dependency
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 13:34:03 +02:00
Enrico Weigelt, metux IT consult
e102c54a28 fb: fix unused function fbInitializeDrawable()
>  ../fb/fbpixmap.c:32:20: warning: unused function 'fbInitializeDrawable' [-Wunused-function]
>      32 | static inline void fbInitializeDrawable(DrawablePtr pDrawable) {}

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-29 19:05:04 +02:00
Enrico Weigelt, metux IT consult
ce9b894f07 include: os.h: fix extra ;
Fix pedantic warnings:

> ../include/os.h:144:71: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
>   144 | XNFalloc(unsigned long /*amount */ ) __attribute__((returns_nonnull));;

> ../include/os.h:158:76: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]
>   158 | XNFcallocarray(size_t nmemb, size_t size) __attribute__((returns_nonnull));;

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-29 19:04:14 +02:00
Enrico Weigelt, metux IT consult
c4f4ad4d93 xfree86: x86emu: drop assert() on uninitialized variable
If assert()s actually enabled, we're having undefined behaviour.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-29 19:01:11 +02:00
Enrico Weigelt, metux IT consult
237d7b1740 .github: don't ignore failing tests anymore
Now that the test suite has been fixed to work on the CI, we no longer
need (and should) ignore broken test runs.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-29 13:29:16 +02:00
Enrico Weigelt, metux IT consult
06a24773d7 bugfix release 25.0.0.11
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xserver-25.0.0.11
2025-08-29 09:32:48 +02:00
Enrico Weigelt, metux IT consult
1d23bf78b3 .github: fix MacOS build
MacOS build suddenly missing xvfb-run, which did work up until few hours ago.
Therefore, make a quick workaround, until the situation is clearly resolved.

The only impact is that some XTS tests (which are ignored on MacOS anyways)
might not work properly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-28 23:23:52 +02:00
Enrico Weigelt, metux IT consult
056ac73757 bugfix release 25.0.0.10
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
xlibre-xserver-25.0.0.10
2025-08-28 19:40:58 +02:00
Enrico Weigelt, metux IT consult
f3f6b8a510 .github: make release message job depend on builds
Make sure the release message won't be created when build jobs on the
release tag didn't succeed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-28 12:57:24 +02:00
Enrico Weigelt, metux IT consult
ec7d647236 test: allow skipping tests on Xephyr with GLES
The GLES tests need an actual GPU (/dev/dri/* device), which is not available
within github CI runners, so we need to skip those when running there.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-28 11:50:22 +02:00
Enrico Weigelt, metux IT consult
c4377c8252 .github: ubuntu: tests: enforce using llvmpipe
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-28 11:19:40 +02:00
Enrico Weigelt, metux IT consult
cc8af9e764 .github: fix tetexec.cfg creation
We need to run the Xts build inside Xvfb, because it needs a running
Xserver for creating tetexec.cfg.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-27 18:58:49 +02:00
Enrico Weigelt, metux IT consult
2cee98c407 test: run various common commands like dpyinfo
Run various common checking commands like xdpyinfo, xvinfo, etc
on both Xvfb directly, as well as Xephyr inside Xvfb.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-27 14:44:42 +02:00
Enrico Weigelt, metux IT consult
e6b0a56076 test: make rendercheck triangles optional
The triangles test of rendercheck is known to be (partially broken on Xephyr,
since it doesn't fully support transparency (eg. a8 surfaces).

Therefore make it optional, so we're not spammed too much by false alarms

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-27 14:34:38 +02:00
Enrico Weigelt, metux IT consult
1cff4cae67 .github: update piglit version
Update piglit version used within the test stage to current master.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-27 14:20:40 +02:00
Enrico Weigelt, metux IT consult
7a2103fc17 .github: use a smarter cloning script
Several sites we need to clone our dependencies from (eg. freedesktop.org)
have pretty unreliable servers, so our CI jobs often fail just because
of temporary clone failure.

Therefore adding a separate cloning script, which is more clever with automatic
retries, but it also tries to keep the traffic low (eg. trying shallow clones
if possible) and automatically detecting whether we're pulling a ref or a
direct commit.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-27 13:25:09 +02:00
Enrico Weigelt, metux IT consult
91cd4e2115 .github: catch piglit results as artifacts
Also store the piglit results into the build artifacts, so we can now
easily look at them later.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-27 12:48:24 +02:00
Enrico Weigelt, metux IT consult
51b5019fe2 Xext: xres: fix XResQueryClientResources request
been using the wrong index for retrieving the resource type atom.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-27 10:06:22 +02:00
Enrico Weigelt, metux IT consult
169a44fcd0 bugfix release 25.0.0.9 xlibre-xserver-25.0.0.9 2025-08-20 14:38:56 +02:00
Enrico Weigelt, metux IT consult
39dfed90fd xkb: fix swapping bug in ProcXkbGetKbdByName()
We've been adding the individual sub-packet's payload bytes *after*
the swapping, which is leading to totally wrong sizes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:26:00 +02:00
Enrico Weigelt, metux IT consult
e40749beb3 dix: fix memory clearing in dix_main()
Clearing of screens and gpuscreens pointer list on teardown has been wrong.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-15 14:26:09 +02:00
Enrico Weigelt, metux IT consult
5c659b4b06 randr: fix size parameter to WriteToClient()
Size computation needs to be done on the struct actually written.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 16:48:07 +02:00
Enrico Weigelt, metux IT consult
d3573913c3 Xi: fix size parameter to WriteToClient()
Size computation needs to be done on the struct actually written.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-14 16:47:54 +02:00
Enrico Weigelt, metux IT consult
7236546874 namespace: fix naming in examples, errors and comments
At some places, there's still the word 'contianer' instead of 'namespace'

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-13 11:49:21 +02:00