Find a file
Olivier Fourdan bfbd77a59a 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>
(cherry picked from commit 03731b326a)
2026-01-25 10:40:01 -08:00
.gitlab-ci ci: Install XCB dependencies for meson tests 2026-01-25 10:40:01 -08:00
composite composite: initialize border clip even when pixmap alloc fails 2026-01-25 10:40:01 -08:00
config linux: Fix BUS_PLATFORM detection for non-PCI devices 2026-01-25 10:40:00 -08:00
damageext damage: drop swapping request length fields 2026-01-25 10:39:59 -08:00
dbe dbe: fix byte swapping in SProcDbeSwapBuffers() 2026-01-25 10:40:00 -08:00
dix os: Do not overflow the integer size with BigRequest 2026-01-25 10:40:01 -08:00
doc doc: drop removed PaintWindowBackground() and PaintWindowBorder() 2026-01-25 10:40:00 -08:00
dri3 dri3: drop swapping request length fields 2026-01-25 10:39:59 -08:00
exa Move sizeof to second argument in calloc calls 2026-01-25 10:39:55 -08:00
fb Revert "fb: Declare wfbFinishScreenInit, wfbScreenInit for !FB_ACCESS_WRAPPER" 2026-01-25 10:39:58 -08:00
glamor glamor: explicitly draw endpoints of line segments 2026-01-25 10:40:00 -08:00
glx glx: DoQueryContext(): explicitly use reply buf type defined by spec 2026-01-25 10:39:58 -08:00
hw xwayland: Do not pretend leaving the X11 surface if buttons are down 2026-01-25 10:40:01 -08:00
include dix-config.h: define HAVE_STRUCT_SOCKADDR_STORAGE for xtrans 1.6 2026-01-25 10:40:01 -08:00
man man pages: strip trailing whitespace 2026-01-25 10:40:01 -08:00
mi mi: use common implementation of bit counting function 2026-01-25 10:40:01 -08:00
miext miext: rootless: fix unused variables 2026-01-25 10:40:00 -08:00
os os: Do not overflow the integer size with BigRequest 2026-01-25 10:40:01 -08:00
present present: need to include geext.h 2026-01-25 10:40:00 -08:00
pseudoramiX pseudoramiX: drop swapping request length fields 2026-01-25 10:39:58 -08:00
randr randr: fix unconditional byte-swap in ProcRRGetProviderInfo() 2026-01-25 10:40:01 -08:00
record record: drop swapping request length fields 2026-01-25 10:39:58 -08:00
render render: Avoid 0 or less animated cursors 2026-01-25 10:40:01 -08:00
test test: remove extra return 2026-01-25 10:40:01 -08:00
Xext sync: Apply changes last in SyncChangeAlarmAttributes() 2026-01-25 10:40:01 -08:00
xfixes xfixes: drop swapping request length fields 2026-01-25 10:39:58 -08:00
Xi Xi: disallow grabbing disabled devices 2026-01-25 10:40:01 -08:00
xkb xkb: Add tbGetBufferString helper function 2026-01-25 10:40:01 -08:00
.appveyor.yml appveyor: Add libxcvt build dep 2021-11-04 13:03:25 +00: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 2026-01-25 10:39:58 -08:00
.gitignore Clean up the .gitignore file 2024-01-12 00:50:24 +00:00
.gitlab-ci.yml ci: fix missing runner tag on FreeBSD jobs after gitlab migration 2026-01-25 10:40:01 -08:00
.mailmap Update mailmap for Peter Harris 2026-01-25 10:40:01 -08:00
.travis.yml travis: Add OSX meson build to matrix 2019-05-02 15:42:58 +00:00
COPYING modesetting: Merge modesetting's COPYING into the xserver's. 2014-09-15 12:46:02 -07:00
meson.build meson.build: print a summary of the DDX to build 2026-01-25 10:40:01 -08:00
meson_options.txt os: drop SUN-DES-1 authentication 2026-01-25 10:39:53 -08:00
README.md Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
xorg-server.m4 xorg-server.m4: just all cflags instead of just sdkdir 2018-09-20 20:12:24 +01:00
xorg-server.pc.in pkgconfig files: Add URL 2026-01-25 10:40:01 -08: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