Commit Graph

20764 Commits

Author SHA1 Message Date
Steven Van Dorp 2ef1e7728e ephyr: fix checking the same expression twice
Probably was a copy-paste error.
Intention is to check if the string is valid
(i.e. not null and length isn't 0).

fixes: #179

Signed-off-by: Steven Van Dorp <steven@vandorp.lu>
2025-06-19 13:57:57 +02:00
dec05eba 4267785e6f xres: fix XResQueryClientIds always returning 0 clients
XaceHookClientAccess added in 098008879b
has incorrect condition in ConstructClientIds.

This fixes #182

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-19 11:29:24 +02:00
Enrico Weigelt, metux IT consult fe4bc433a4 sdk: reinstate COMPOSITE symbol
Composite extension is always enabled for pretty long time now, but some
drivers (eg. xf86-video-intel) still relying on this symbol being set,
otherwise assuming to run w/o composite and doing crazy things.

Fixes: d708b28adc
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-19 11:21:31 +02:00
rendick ca5fb14d05 dix: delete unused PropertyStateRec structure to debloat codebase
Removed unused 'PropertyStateRec' structure from dix/property.c

Signed-off-by: rendick <rendick123@proton.me>
2025-06-18 21:26:40 +02:00
Olivier Fourdan 899afa4c10 os: Check for integer overflow on BigRequest length
Check for another possible integer overflow once we get a complete xReq
with BigRequest.

Related to CVE-2025-49176

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Suggested-by: Peter Harris <pharris2@rocketsoftware.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2028>
2025-06-18 17:51:36 +02:00
Steven Van Dorp b393d5fc02 ephyr: Add -host-grab to set custom grab shortcut
Allows for calling Xephyr with `-host-grab [keys]` to customize the
keyboard shortcut for grabbing/releasing keyboard and mouse input.
Fully backwards compatible:
Omitting `-host-grab` defaults to ctrl+shift.
`-no-host-grab` acts the same as before.

Closes: #134

Signed-off-by: Steven Van Dorp <steven@vandorp.lu>
2025-06-18 13:23:58 +02:00
Duje Mihanović 61accf16e2 Revert "xfree86: unexport xf86PostButtonEventM()"
This reverts commit e16424212e.

The xf86-input-wacom driver requires this function.

Signed-off-by: Duje Mihanović <duje@dujemihanovic.xyz>
2025-06-17 20:47:17 +02:00
Enrico Weigelt, metux IT consult f5d4657d0d meson.build: add deprecation warning on HAL
When HAL is enabled, print out a warning that it's deprecated and
might be removed soon.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:41:48 +02:00
Enrico Weigelt, metux IT consult 99992bc2f6 meson_options: set default for HAL integration to false
This should be a deliberate decision of the user/distro. Just the presense
of some of its libraries in the build environment doesn't automatically
mean the user/distro actually wants it to be used.

HAL is pretty much obsolete, so we're considering to drop it entirely.
Anybody who's still needs it should call out loud now.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:41:48 +02:00
Enrico Weigelt, metux IT consult dba86284c8 meson_options: set default value for systemd support to false
a) the automatic detection logic is broken: it automatically enables it
   when kms+udev enabled and dbus is found.
b) it should be a deliberate decision whether to enable it or not,
   eg. just having (pieces of) systemd libraries present on the build
   machine doesn't automatically mean the user/distro actually wants
   it to be used.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:41:48 +02:00
Enrico Weigelt, metux IT consult 49f5056b45 .github: run pipeline on pull requests
Also run the pipeline on pull requests, so nothing utterly broken
can easily slip in.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:33:00 +02:00
Enrico Weigelt, metux IT consult 36a24ef23c .github: drop -Dxwayland=false
Xwayland had been dropped, so no need to switch it off explicitly
anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:33:00 +02:00
Olivier Fourdan 923837e2c9 xfree86: Check for RandR provider functions
Changing XRandR provider properties if the driver has set no provider
function such as the modesetting driver will cause a NULL pointer
dereference and a crash of the Xorg server.

Related to CVE-2025-49180

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan 948630fa42 randr: Check for overflow in RRChangeProviderProperty()
A client might send a request causing an integer overflow when computing
the total size to allocate in RRChangeProviderProperty().

To avoid the issue, check that total length in bytes won't exceed the
maximum integer value.

CVE-2025-49180

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan da5f8d197f record: Check for overflow in RecordSanityCheckRegisterClients()
The RecordSanityCheckRegisterClients() checks for the request length,
but does not check for integer overflow.

A client might send a very large value for either the number of clients
or the number of protocol ranges that will cause an integer overflow in
the request length computation, defeating the check for request length.

To avoid the issue, explicitly check the number of clients against the
limit of clients (which is much lower than an maximum integer value) and
the number of protocol ranges (multiplied by the record length) do not
exceed the maximum integer value.

This way, we ensure that the final computation for the request length
will not overflow the maximum integer limit.

CVE-2025-49179

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan 0d6af5a542 os: Account for bytes to ignore when sharing input buffer
When reading requests from the clients, the input buffer might be shared
and used between different clients.

If a given client sends a full request with non-zero bytes to ignore,
the bytes to ignore may still be non-zero even though the request is
full, in which case the buffer could be shared with another client who's
request will not be processed because of those bytes to ignore, leading
to a possible hang of the other client request.

To avoid the issue, make sure we have zero bytes to ignore left in the
input request when sharing the input buffer with another client.

CVE-2025-49178

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan a1e44d3c4f xfixes: Check request length for SetClientDisconnectMode
The handler of XFixesSetClientDisconnectMode does not check the client
request length.

A client could send a shorter request and read data from a former
request.

Fix the issue by checking the request size matches.

CVE-2025-49177

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

Fixes: e167299f6 - xfixes: Add ClientDisconnectMode
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2024>
2025-06-17 20:01:25 +02:00
Olivier Fourdan 3151e489e4 os: Do not overflow the integer size with BigRequest
The BigRequest extension allows requests larger than the 16-bit length
limit.

It uses integers for the request length and checks for the size not to
exceed the maxBigRequestSize limit, but does so after translating the
length to integer by multiplying the given size in bytes by 4.

In doing so, it might overflow the integer size limit before actually
checking for the overflow, defeating the purpose of the test.

To avoid the issue, make sure to check that the request size does not
overflow the maxBigRequestSize limit prior to any conversion.

The caller Dispatch() function however expects the return value to be in
bytes, so we cannot just return the converted value in case of error, as
that would also overflow the integer size.

To preserve the existing API, we use a negative value for the X11 error
code BadLength as the function only return positive values, 0 or -1 and
update the caller Dispatch() function to take that case into account to
return the error code to the offending client.

CVE-2025-49176

This issue was discovered by Nils Emmerich <nemmerich@ernw.de> and
reported by Julian Suleder via ERNW Vulnerability Disclosure.

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/2024>
2025-06-17 20:01:25 +02:00
Enrico Weigelt, metux IT consult c430c829d5 render: fix CVE-2025-49175
Protect against clients sending a series of zero cursors.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 20:01:25 +02:00
dasha_uwu b418203339 README.md: fix drivers list
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-17 19:57:24 +02:00
Enrico Weigelt, metux IT consult fd02fc0b04 .github: workflow for building Xservers and some drivers
Add a github workflow that builds the Xservers on Linux and also
runs build-test of several common drivers against xorg sdk.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 19:45:34 +02:00
Enrico Weigelt, metux IT consult 4939439952 dix: drop PropertyStateCallback
This callback only had been added for Xwayland, which is gone now,
so we don't need it anymore. For property filtering (eg. security
extensions), we have PropertyFilterCallback.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 12:51:36 +02:00
Enrico Weigelt, metux IT consult c8b81fdbc5 drop Xwayland
It always had it's own lifecycle (not been part of Xorg releases),
doesn't make sense to maintain a competing implementation that we
won't use anyways.

Once that's gone, we can also drop few things in core/dix that had
been added just for xwayland only.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-17 12:51:36 +02:00
Hermann Semenov d042e5a667 os: fix missing NULL check for vpnprintf()
Protect from NULL parameter to %s directive.

See also: https://github.com/X11Libre/xserver/issues/36

Signed-off-by: Herman Semenov <GermanAizek@yandex.ru>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-16 20:28:01 +02:00
stefan11111 fa7cc111e7 xfree86: compat: add missing symbols needed by the proprietary nvidia drivers
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
2025-06-16 20:07:18 +02:00
Michael Bear a43c9d8719 README.md: Link to parent project
Signed-off-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
2025-06-16 15:49:59 +02:00
Michael Bear 7d5bc27184 README.md: Capitalize GitHub (noun) in README.md
Signed-off-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
2025-06-16 15:49:59 +02:00
Michael Bear 1166015703 README.md: Add "to" for "to be prepared"
Signed-off-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
2025-06-16 15:49:59 +02:00
Michael Bear 8b06efa654 README.md: Grammar an >> a
Signed-off-by: Michael Bear <38406045+mjbear@users.noreply.github.com>
2025-06-16 15:49:59 +02:00
AnasSaeed1 b63868ba23 Fix typo in README.md 2025-06-16 15:19:54 +02:00
dasha_uwu 69cc9b1cd3 change vendor string to XLibre
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:38:33 +02:00
dasha_uwu cacdcc5b2e dix: export DeliverEvents for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 27f1094116 randr: export RRGetOutputProperty for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 8ebab6ca3e panoramix: export PanoramiXTranslateVisualID for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 3db3ca9889 dix: export TryClientEvents for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu a776156b54 treewide: preemptively revert !1714 where it affects ABI compatibility
this adds dummy pointers in place of removed fields in some structs, only for
SDK headers, to preserve ABI
some of these fix segfaults for nvidia driver, some are preemptive

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 1489474583 dix: remove unused NAMESPACE private type
in struct _Screen (include/scrnintstr.h) there is a PRIVATE_LAST-sized array,
having another private increases PRIVATE_LAST, the array increases in size,
moving everything below it down. this breaks ABI for nvidia driver

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 545f6ca8b7 randr: fix BUG_RETURN_VAL check
nvidia driver can call with numOutputs == 0 and outputs == NULL which is valid

Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 45de44f092 os: export SetCriticalOutputPending for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu e73bb5d01b geext: export GERegisterExtension for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 1fe4d2d4ca randr: export RROutputSetSubpixelOrder for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
dasha_uwu 3c20d33e2c randr: export RRCrtcSetTransformSupport for nvidia
Signed-off-by: dasha_uwu <dasha@linuxping.win>
2025-06-16 10:32:48 +02:00
Steven Van Dorp 9acf6a4b63 ephyr: explicitly zero-initialize ephyrCursorScreen
Signed-off-by: Steven Van Dorp <steven@vandorp.lu>
2025-06-14 17:28:13 +02:00
Steven Van Dorp c5f63fa138 ephyr: fix possible segfault if eyphrCursorScreen is 0
Fixes: #38

Signed-off-by: Steven Van Dorp <steven@vandorp.lu>
2025-06-14 17:28:13 +02:00
rendick cd2e185838 Xnest: implement a defined initialization order in BoxRec
Signed-off-by: rendick <rendick123@proton.me>
2025-06-13 19:15:41 +02:00
cat a0f4a5585d Rebrand 'X.Org X Server' to 'XLibre X Server'
Signed-off-by: cat <cat@plan9.rocks>
2025-06-13 19:08:11 +02:00
dec05eba 2f66431927 xi: Fix build on arch linux (cast between struct and union gcc error)
Fixes this build error on arch linux:

../Xi/exevents.c:1394:26: error: array subscript ‘InternalEvent {aka union _InternalEvent}[0]’ is partly outside array bounds of ‘DeviceEvent[1]’ {aka ‘struct _DeviceEvent[1]’} [-Werror=array-bounds=]
 1394 |                 evtype = GetXI2Type(ev->any.type);
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~
../Xi/exevents.c: In function ‘DeliverEmulatedMotionEvent’:
../Xi/exevents.c:1571:17: note: object ‘motion’ of size 432
 1571 |     DeviceEvent motion;
      |

which happens because of change in build options compared to master and gcc 15.1 in arch. I think this warning (and error) is a bug in gcc.

gcc 15.1 doesn't like when struct DeviceEvent is cast to union InternalEvent.
InternalEvent has a union any type and DeviceEvent type and these have to have a matching structure (for the header part).
When the InternalEvent is used in RetrieveTouchDeliveryData function it access the any field, which accessed the data defined previously in the device_event fields.
This change matches how its done in touch.c TouchEmitTouchEnd for example and it's "more correct",
since we are no longer casting from a smaller struct (DeviceEvent) to a larger struct (InternalEvent) when calling RetrieveTouchDeliveryData.

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-13 19:08:17 +02:00
dec05eba 8c3c20f3fe xnest/os: Fix incorrect power of two operator
2^16 is 2 xor 16 which equals 18, not 2 to the power of 16 which is 65536

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-13 13:27:25 +02:00
EXtremeExploit 904f87c0b5 Add Contribution Guidelines
The guidelines come from metux's heads up mail:
https://www.freelists.org/post/xlibre/Heads-up-branch-changes-and-MR-policies

Signed-off-by: EXtremeExploit <pedro.montes.alcalde@gmail.com>
2025-06-13 13:03:26 +02:00
dec05eba f397039d65 xres/xkb/xvmc/modesetting: Fix incorrect pointer data size usage
* xled change tested with `xset led named "Scroll Lock"`
* modesetting change tested with `xrandr --output DP-1 --gamma 0.5:0.5:0.5`.
  Without this fix that command does nothing
* xvmc change tested with `mpv --vo=xv video.mp4`

Of the currently reported issues this fixes #104

Signed-off-by: dec05eba <dec05eba@protonmail.com>
2025-06-13 13:01:24 +02:00