Find a file
Olivier Fourdan a40b41497f xkb: Fix out-of-bounds read in CheckModifierMap()
As reported by valgrind:

  == Conditional jump or move depends on uninitialised value(s)
  ==    at 0x547E5B: CheckModifierMap (xkb.c:1972)
  ==    by 0x54A086: _XkbSetMapChecks (xkb.c:2574)
  ==    by 0x54A845: ProcXkbSetMap (xkb.c:2741)
  ==    by 0x556EF4: ProcXkbDispatch (xkb.c:7048)
  ==    by 0x454A8C: Dispatch (dispatch.c:553)
  ==    by 0x462CEB: dix_main (main.c:274)
  ==    by 0x405EA7: main (stubmain.c:34)
  ==  Uninitialised value was created by a heap allocation
  ==    at 0x4840B26: malloc (vg_replace_malloc.c:447)
  ==    by 0x592D5A: AllocateInputBuffer (io.c:981)
  ==    by 0x591F77: InsertFakeRequest (io.c:516)
  ==    by 0x45CA27: NextAvailableClient (dispatch.c:3629)
  ==    by 0x58FA81: AllocNewConnection (connection.c:628)
  ==    by 0x58FC70: EstablishNewConnections (connection.c:692)
  ==    by 0x58FFAA: HandleNotifyFd (connection.c:809)
  ==    by 0x593F42: ospoll_wait (ospoll.c:660)
  ==    by 0x58B9B6: WaitForSomething (WaitFor.c:208)
  ==    by 0x4548AC: Dispatch (dispatch.c:493)
  ==    by 0x462CEB: dix_main (main.c:274)
  ==    by 0x405EA7: main (stubmain.c:34)

The issue is that the loop in CheckModifierMap() reads from wire without
verifying that the data is within the request bounds.

The req->totalModMapKeys value could exceed the actual data provided,
causing reads of uninitialized memory.

To fix that issue, we add a bounds check using _XkbCheckRequestBounds,
but for that, we need to also pass a ClientPtr parameter, which is not
a problem since CheckModifierMap() is a private, static function.

CVE-2026-34002, ZDI-CAN-28737

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

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f056ce1cc9)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2177>
2026-04-14 15:09:04 +02:00
.gitlab-ci CI: update libdecor from 0.1.0 to 0.1.1 2024-09-24 11:33:02 +02:00
composite composite: initialize border clip even when pixmap alloc fails 2025-02-25 19:38:11 +01:00
damageext Remove autotools support 2021-10-27 13:15:40 +03:00
dbe Drop Xorg DDX 2024-04-12 10:40:05 +02:00
dix dix: avoid null ptr deref at doListFontsAndAliases 2026-04-09 08:59:09 +00:00
doc dix: dixutils: make workQueue pointer dix-private 2024-02-23 23:06:38 +00:00
dri3 Drop Xorg DDX 2024-04-12 10:40:05 +02:00
fb Drop Xorg DDX 2024-04-12 10:40:05 +02:00
glamor glamor: avoid double free in glamor_make_pixmap_exportable() 2026-04-09 08:59:08 +00:00
glx Drop Xorg DDX 2024-04-12 10:40:05 +02:00
hw xwayland: Use viewport scale for warping coordinates 2026-04-09 08:59:09 +00:00
include xkb: Make the RT_XKBCLIENT resource private 2025-10-28 14:27:03 +01:00
man Drop Xorg DDX 2024-04-12 10:40:05 +02:00
mi mi: guard miPointer functions against NULL dereferences 2025-04-08 10:03:30 +02:00
miext miext/sync: Fix use-after-free in miSyncTriggerFence() 2026-04-14 15:09:04 +02:00
os os: include <assert.h> in ospoll.c 2026-04-09 08:59:09 +00:00
present present: Fix use-after-free in present_create_notifies() 2025-10-28 14:27:03 +01:00
randr randr: clear primary screen's primaryOutput when the output is deleted 2026-04-09 08:59:09 +00:00
record record: Check for overflow in RecordSanityCheckRegisterClients() 2025-06-17 15:08:10 +02:00
render render: fix multiple mem leaks on err paths 2026-04-09 08:59:09 +00:00
test test: Fix xsync test 2025-02-25 19:38:08 +01:00
Xext panoramix: avoid null dereference in PanoramiXConsolidate() 2026-04-09 08:59:08 +00:00
xfixes xfixes: Check request length for SetClientDisconnectMode 2025-06-17 15:07:52 +02:00
Xi Xi: handle allocation failure in add_master_func() 2025-10-21 08:56:39 +02:00
xkb xkb: Fix out-of-bounds read in CheckModifierMap() 2026-04-14 15:09:04 +02:00
.appveyor.yml Drop Xephyr / kdrive DDX 2024-04-12 10:40:05 +02:00
.dir-locals.el .dir-locals.el: Add missing final newline 2019-10-01 17:05:28 +00:00
.gitignore Clean up the .gitignore file 2024-01-12 00:50:24 +00:00
.gitlab-ci.yml CI: update libdecor from 0.1.0 to 0.1.1 2024-09-24 11:33:02 +02:00
.mailmap Add a .mailmap file to canonicalize author names and emails 2023-03-15 18:10:51 +00:00
COPYING COPYING: add author to HPND-sell-MIT-disclaimer-xserver 2026-04-09 08:59:09 +00:00
meson.build os: fix sha1 build error with Nettle 4.0 2026-04-09 08:59:09 +00:00
meson_options.txt meson: Build Xwayland unconditionally 2024-04-12 10:40:05 +02:00
README.md Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
SECURITY.md xwayland: Expunge the SECURITY.md file 2026-04-09 08:59:08 +00:00
xserver.ent.in doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00

X Server

The X server accepts requests from client applications to create windows, which are (normally rectangular) "virtual screens" that the client program can draw into.

Windows are then composed on the actual screen by the X server (or by a separate composite manager) as directed by the window manager, which usually communicates with the user via graphical controls such as buttons and draggable titlebars and borders.

For a comprehensive overview of X Server and X Window System, consult the following article: https://en.wikipedia.org/wiki/X_server

All questions regarding this software should be directed at the Xorg mailing list:

https://lists.freedesktop.org/mailman/listinfo/xorg

The primary development code repository can be found at:

https://gitlab.freedesktop.org/xorg/xserver

For patch submission instructions, see:

https://www.x.org/wiki/Development/Documentation/SubmittingPatches

As with other projects hosted on freedesktop.org, X.Org follows its Code of Conduct, based on the Contributor Covenant. Please conduct yourself in a respectful and civilized manner when using the above mailing lists, bug trackers, etc:

https://www.freedesktop.org/wiki/CodeOfConduct