XLibre Xserver
  • C 96.3%
  • Roff 1.2%
  • Objective-C 1%
  • Meson 0.9%
  • Python 0.2%
  • Other 0.2%
Find a file
Peter Hutterer fd35d20593 xkb: clamp nMaps to mapWidths buffer size in CheckKeyTypes
CheckKeyTypes computes nMaps = firstType + nTypes from client-controlled
request fields when XkbSetMapResizeTypes is set. This value is used to
index mapWidths[], a stack-allocated CARD8 array of XkbMaxLegalKeyCode + 1
(256) elements. No upper bound is enforced on nMaps.

An attacker can first send SetMap(firstType=0, nTypes=255, ResizeTypes) to
set the server's num_types to 255, then send SetMap(firstType=255,
nTypes=10, ResizeTypes). The firstType > num_types check passes because
255 > 255 is false (the check uses > rather than >=). nMaps is then
computed as 265, and the loop writes mapWidths[255..264], overflowing 9
bytes past the stack buffer into adjacent stack variables (symsPerKey[]).

Fix by rejecting requests where firstType + nTypes would exceed the
mapWidths buffer size (XkbMaxLegalKeyCode + 1).

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

ZDI-CAN-30161

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2228>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2026-06-03 19:20:41 +02:00
.github lint: Add .clang-tidy and analyzer scripts 2026-05-26 12:15:17 +02:00
.vscode lint: Add .clang-tidy and analyzer scripts 2026-05-26 12:15:17 +02:00
composite composite: use new X_REPLY_FIELD_* macros 2026-04-28 17:30:41 +02:00
config config: Fix build with udev disabled 2026-05-20 20:01:30 +02:00
dbe dbe: use new X_REPLY_FIELD_* macros 2026-04-28 17:15:54 +02:00
dix dix: increase XLFDMAXFONTNAMELEN to match libXfont2's MAXFONTNAMELEN 2026-06-03 19:07:48 +02:00
doc Fix typos 2026-04-19 12:32:26 +02:00
dri3 dri3: use new X_REPLY_FIELD_* macros 2026-04-28 17:20:01 +02:00
exa treewide: clean up includes of mipict.h 2026-04-30 14:51:33 +02:00
fb treewide: clean up includes of mipict.h 2026-04-30 14:51:33 +02:00
glamor glamor/glamor_egl: Export pixmaps directly from GL textures 2026-06-02 16:02:14 +02:00
glx glx: fix reversed length check in ChangeDrawableAttributes 2026-06-03 19:08:16 +02:00
hw kdrive/fbdev: Fix handling of -dri when it has no path and is not the last arg 2026-06-03 15:38:14 +02:00
include glamor/glamor_egl: Import pixmaps directly from dma bufs 2026-05-29 13:35:43 +02:00
man Treewide: Fix typos 2026-03-16 13:11:07 +01:00
mi mi: fail on reallocarray failure in miAppendSpans 2026-05-04 16:54:47 +02:00
miext sync: fix deletion of counters and fences 2026-06-03 17:49:13 +02:00
os os: check ospoll allocation failures 2026-06-03 19:10:01 +02:00
present present: actually return the created notifies 2026-05-21 16:50:34 +02:00
pseudoramiX pseudoramiX: drop obsolete support for internal server reset 2025-11-20 19:23:39 +01:00
randr randr/rrsdispatch: reject invalid format in SProcRRChangeProviderProperty 2026-05-22 14:04:52 +02:00
record record: fix reply structs 2025-12-03 18:00:00 +01:00
render render: fix memory leaks on XaceHook failure in resource creation 2026-05-21 16:59:36 +02:00
test tests: plug leak of results in compute_expected_damage() 2026-04-21 12:19:39 +02:00
Xext dri2: Use booleans for (fake) front buffer tracking in do_get_buffers 2026-06-03 19:09:51 +02:00
xfixes xfixes: cursor: declare variables where needed in ReplaceCursorLookup() 2026-05-08 17:28:00 +02:00
Xi Xi: add missing gesture grab type checks in ProcXIPassiveUngrabDevice 2026-05-21 20:32:43 +02:00
xkb xkb: clamp nMaps to mapWidths buffer size in CheckKeyTypes 2026-06-03 19:20:41 +02:00
.appveyor.yml os: use internal xtrans instead of external library 2025-07-18 22:29:38 +02:00
.clang-tidy lint: Add .clang-tidy and analyzer scripts 2026-05-26 12:15:17 +02:00
.dir-locals.el .dir-locals.el: Add missing final newline 2019-10-01 17:05:28 +00:00
.git-blame-ignore-revs Ignore the coding style change commit during git blame 2024-12-06 09:55:53 +10:00
.gitignore lint: Add .clang-tidy and analyzer scripts 2026-05-26 12:15:17 +02:00
.mailmap Update mailmap for Peter Harris 2025-04-15 13:49:13 -04:00
CoC.md it's time to add a CoC (code of conduct) 2025-06-12 17:21:47 +02:00
CODE_OF_CONDUCT.md it's time to add a CoC (code of conduct) 2025-06-12 17:21:47 +02:00
CODE_OVERVIEW.md doc: add CODE_OVERVIEW.md 2026-04-22 19:18:03 +02:00
CONTRIBUTING.md fix minor spelling mistake in contributing guidelines 2025-09-05 15:05:37 +02:00
COPYING COPYING: add author to HPND-sell-MIT-disclaimer-xserver 2026-03-16 13:25:53 +01:00
HISTORY.md HISTORY.md: add brief overview of the XLibre fork 2025-07-25 08:06:47 -04:00
meson.build meson.build: test for possibly unsupported flags 2026-05-27 14:34:03 +02:00
meson_options.txt meson: Add -Dgbm build option 2026-05-21 20:32:54 +02:00
NEWS release 25.1 2025-12-21 15:53:30 +01:00
README.md README.md: update Matrix space address 2026-05-01 01:55:24 +00:00
xlibre-server.pc.in xorg-server.pc: add more variables for easier driver builds 2026-01-08 16:57:10 +01:00
xorg-server.m4 xorg-server.m4: add helper macros for driver builds 2026-01-08 17:17:12 +01:00
xorg-server.pc.in xorg-server.pc: add more variables for easier driver builds 2026-01-08 16:57:10 +01:00
xserver.ent.in doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00

XLibre Xserver

XLibre running on FreeBSD
XLibre running on FreeBSD. See more liberated screens here.

XLibre is a display server implementation of the X Window System Protocol Version 11 (Wikipedia), in short X11. It has been forked from the X.Org Server (Wikipedia). For the reasons for the fork, please see the HISTORY.md.

Our mission

The XLibre contributors strive to clean up and strengthen the existing code base while maintaining backward compatibility to make X11 a viable choice for the future. Another goal is to actively enhance the functionality of the Xserver and its drivers. We also take care of the improvements to the X.Org Server that have been unreleased for several years or were made to Xwayland only. Our decision-making is based on merit and our active community keen to bring X forward.

Our achievements

Since the fork on June 5, 2025, our by now more than 30 contributors have, e.g., released numerous code cleanups, the Xnamespace extension for separating X clients, and backported the June 2025 X.Org CVE fixes. Together we integrated TearFree by default and allowed enabling atomic modesetting. Xnest was ported to xcb, per-ABI driver directories were introduced, and XQuartz has been added to our build jobs. We have fought through all the issues that have been thrown at us, reached the first stage of the associated workflow, and established our support for packaging XLibre by volunteers. We have also made a first release announcement and created the NEWS.

A side note: If your XLibre Xserver is already set up and running, you may want to skip to our roadmap.

XLibre running accelerated on RK3588
XLibre running accelerated on RK3588. See more liberated screens here.

Switching to XLibre

The easiest way to install and run XLibre is to use your distribution's provided packages. Please see the Are We XLibre Yet? - (X11Libre/xserver Wiki) page for a list of the available options. If there is no option, then go on with building and installing XLibre from source.

Building XLibre

After cloning the Xserver repository or unpacking the sources and installing the dependencies, change into the source directory and run the Meson build tool:

cd "<source dir of xserver>"
meson setup <prefix> build <meson_options>
ninja -C build install

You may specify the install <prefix> with, for example, --prefix="$(pwd)/image" and add build time <meson_options> like so: -Dxnest=false. You may also want to build and install some graphics and input drivers. Please refer to the Building XLibre (X11Libre/xserver Wiki) page for more details.

Configuring XLibre

To enable loading of the proprietary Nvidia driver in the XLibre Xserver up to version 25.0.0.15, please add the following to your X configuration, e.g., /etc/X11/xorg.conf:

Section "ServerFlags"
  Option "IgnoreABI" "1"
EndSection

Starting with version 25.0.0.16, the proprietary Nvidia driver is autodetected and handled internally without any special configuration. Please see the Compatibility of XLibre (X11Libre/xserver Wiki) page for more details on the Nvidia driver and compatibility in general.

Until XLibre releases its own, you can find a detailed description of the configuration on the Configuration - Xorg (ArchWiki) page. If you have built and installed XLibre yourself, then change into the <prefix> directory with cd <prefix> and create a directory etc/X11 with a file xorg.conf and adjust it accordingly.

Running XLibre

If you installed XLibre using your distribution's provided packages, then the Xserver is usually started by init (Wikipedia) on system start. On other systems it should be possible to manually start XLibre with user permissions by invoking startx. Please refer to man startx for how to use it.

If you have built and installed XLibre yourself, then you may want to shutdown other Xservers, change into the <prefix> directory, and create a simple testx.sh file with the following contents:

#!/bin/sh
./bin/X :1 vt8 &
_pid=$!
sleep 10 && kill $_pid

You can adjust the :1 vt8 and other options in the testx.sh file as detailed in man Xorg. Make the testx.sh executable and run it:

chmod 0770 testx.sh
./testx.sh

This should give you 10 glorious seconds of a black and beautiful and empty screen. Afterwards the Xserver complains about being killed, but there should be no other critical errors for a "test passed." For more details, please see Building XLibre (X11Libre/xserver Wiki).

Our roadmap

Roughly speaking, we will continue to clean up and modernize the codebase, enhance our continuous integration, add static code analysis, and improve manual and automated testing. Therefore, we will consolidate our build infrastructure and release process and also add more platforms to the test cycle. We will also further look into separating X clients by the Xnamespace extension and providing practical examples of how to use it.

Some of the many ideas and feature requests we received will be refined and prepared for implementation, and we will go on to integrate relevant but unreleased Xorg and Xwayland features as well. Our documentation will see improvements on how to build, configure, and switch to XLibre. A revamp of our website, the creation of a logo, and more rebranding to XLibre are also on the map. End of roughly speaking.

One of the very next steps is to concretize our roadmap by using the GitHub Projects feature to arrange and prioritize bug reports, feature requests, and other issues. This will give anybody a clear picture of what is next. All in the open so you can follow along and, more so, participate.

I want to help!

That's great; there's enough to do for everyone. You may consider one of the many ideas and feature requests out there, like adding static code analysis/coverage, creating a logo for XLibre or becoming an XLibre Test Driver.

There is also a good chance to enhance the documentation of Xnamespace and add more details to the Building XLibre and Graphics devices & drivers wiki pages. Or to update the desktop environments and display managers lists as things work for you.

To wrap things up, please have a look at the XLibre On Other Distributions discussion. There is already some nice work going on, and also some more could be done, like creating XLibre packages in OpenSuse Build Service (OBS). Or create a platform cheat sheet in general.

That's not enough? Then have a glance at the good first and help wanted issues. There are more to come, especially for code cleanups. If you want to work on anything, just let us know. If you have any questions, just ask. We thank you!

You're welcome!

XLibre running on NixOS
XLibre running on NixOS. See more liberated screens here.

This is an independent project, not at all affiliated with BigTech or any of their subsidiaries or tax evasion tools, nor any political activist groups, state actors, etc. It's explicitly free of any "DEI" or similar discriminatory policies. Anybody who's treating others nicely is welcome.

It doesn't matter which country you're coming from, your political views, your race, your sex, your age, your food menu, whether you wear boots or heels, whether you're furry or fairy, Conan or McKay, a comic character, a small furry creature from Alpha Centauri, or just a boring average person. Anybody who's interested in bringing X forward is welcome.

Together we'll make X great again!

Contact

XLibre Discussions at GitHub | XLibre mailing list at FreeLists | @x11dev channel at Telegram | #xlibredev space at Matrix | XLibre security contact at GitHub

Interview: Meet Enrico Weigelt, the maintainer of the new XLibre fork - Felipe Contreras