xserver/record
Olivier Fourdan 8592cab682 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>
(cherry picked from commit 2bde9ca49a)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2025>
2025-06-17 15:06:30 +02:00
..
Makefile.am get rid of XFree86LOADER, XFree86Server, XFree86Module, and IN_MODULE 2006-07-18 18:17:38 -04:00
meson.build Add a Meson build system alongside autotools. 2017-04-26 15:25:27 -07:00
record.c record: Check for overflow in RecordSanityCheckRegisterClients() 2025-06-17 15:06:30 +02:00
set.c Convert top level extensions to new *allocarray functions 2015-04-21 16:57:08 -07:00
set.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00