xserver/os
Olivier Fourdan 7996ac60d8 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>
(cherry picked from commit d55c54cecb)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2025>
2025-06-17 15:06:20 +02:00
..
.gitignore dix and os: gitignore dix.O and os.O 2011-09-23 17:14:47 -07:00
access.c os: Fix NULL pointer dereference 2025-02-05 15:02:23 +01:00
auth.c Switch to libbsd-overlay 2023-10-23 23:30:14 -04:00
backtrace.c os: include unistd.h when HAVE_PSTACK is defined 2021-05-27 21:33:12 +00:00
busfault.c os: Fix iteration over busfaults 2017-02-23 09:20:48 +10:00
client.c Return NULL in *cmdname if the client argv or argv[0] is NULL 2024-10-22 21:07:14 +00:00
connection.c os/connection: Make sure partial is initialized 2025-02-05 15:02:24 +01:00
inputthread.c os, shm: fcntl()'s third argument is integer, not pointer 2020-12-18 09:36:30 -05:00
io.c os: Account for bytes to ignore when sharing input buffer 2025-06-17 15:06:20 +02:00
log.c os: Remove support for Tiger and earlier versions of macOS 2021-02-01 16:21:39 -08:00
Makefile.am dtrace: Move Xserver.d from dix/ to include/ 2019-08-27 17:38:54 -04:00
meson.build meson: Fix warnings when reading back and checking feature flags 2021-07-05 12:46:14 +00:00
mitauth.c os: make MitGenerateCookie() independent of XCSECURITY 2017-08-22 10:59:40 -04:00
oscolor.c Use ARRAY_SIZE all over the tree 2017-10-30 13:45:20 -04:00
osdep.h os: Remove mffs() 2017-11-06 17:22:46 -05:00
osinit.c os: Make OsSignalHandler ask for core dumps for signo != SIGQUIT 2017-12-13 11:11:42 -05:00
ospoll.c ospoll: Fix Solaris ports implementation to build on Solaris 11.4 2019-09-23 15:12:01 -07:00
ospoll.h os: Add ospoll interface [v2] 2016-07-21 15:04:47 -04:00
reallocarray.c Import reallocarray() from OpenBSD 2015-04-21 16:57:08 -07:00
rpcauth.c auth: remove AuthToIDFunc and associated functions. Not used anymore. 2017-02-28 14:15:19 -05:00
strcasecmp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strcasestr.c Remove unneeded include of dix.h from strcasestr.c 2019-04-30 20:07:51 +00:00
strlcat.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcpy.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strndup.c os: Ensure <dix-config.h> is included in strndup.c 2013-02-14 09:20:46 -08:00
timingsafe_memcmp.c timingsafe_memcmp: Fix meson build 2017-05-10 10:56:16 -04:00
utils.c Allow disabling byte-swapped clients 2024-03-23 14:42:15 -07:00
WaitFor.c os: NextDPMSTimeout: mark intentional fallthroughs in switch 2025-02-05 15:02:23 +01:00
xdmauth.c auth: remove AuthToIDFunc and associated functions. Not used anymore. 2017-02-28 14:15:19 -05:00
xdmcp.c include: Remove now-empty site.h 2019-10-30 16:17:04 +00:00
xprintf.c os/xprintf: add Xvscnprintf and Xscnprintf 2012-05-03 14:59:23 +10:00
xserver_poll.c os: Fix build of xserver_poll.c on MinGW 2019-05-18 14:59:38 +00:00
xsha1.c os: unbreak xsha1 on FreeBSD 2020-05-27 07:15:07 +00:00
xstrans.c Clean up a couple of warnings in os/ 2013-10-31 16:58:12 -07:00