Find a file
Olivier Fourdan 4f8a851b60 xwayland: Cancel the EI disconnect timer when freed
Xwayland maintains a connection to EI up for 10 minutes after an X11
client has vanished, to avoid going through the connection phase every
time a short lived X11 client comes and goes.

However, if the EI client gets freed (through some other event, e.g. the
user decides to terminate the EI session), Xwayland would still keep the
callback alive and end up trying to free an already freed EI client:

 Invalid read of size 4
    at 0x4C5E6F9: object_unref (util-object.h:89)
    by 0x4C5E6F9: ei_unref (libei.c:77)
    by 0x429525: free_ei (xwayland-xtest.c:224)
    by 0x429A6E: disconnect_timer_cb (xwayland-xtest.c:404)
    by 0x5E63FF: DoTimer (WaitFor.c:276)
    by 0x5E6463: DoTimers (WaitFor.c:290)
    by 0x5E6164: check_timers (WaitFor.c:133)
    by 0x5E61E9: WaitForSomething (WaitFor.c:195)
    by 0x4AD50E: Dispatch (dispatch.c:487)
    by 0x4BBA0B: dix_main (main.c:272)
    by 0x43615D: main (stubmain.c:34)
  Address 0x15cc6ee8 is 8 bytes inside a block of size 240 free'd
    at 0x48452AC: free (vg_replace_malloc.c:974)
    by 0x4C5E729: object_destroy (util-object.h:73)
    by 0x4C5E729: object_unref (util-object.h:91)
    by 0x4C5E729: ei_unref (libei.c:77)
    by 0x429525: free_ei (xwayland-xtest.c:224)
    by 0x42A946: xwl_handle_ei_event (xwayland-xtest.c:804)
    by 0x5EA977: HandleNotifyFd (connection.c:809)
    by 0x5EE8E3: ospoll_wait (ospoll.c:657)
    by 0x5E624D: WaitForSomething (WaitFor.c:208)
    by 0x4AD50E: Dispatch (dispatch.c:487)
    by 0x4BBA0B: dix_main (main.c:272)
    by 0x43615D: main (stubmain.c:34)
  Block was alloc'd at
    at 0x484782C: calloc (vg_replace_malloc.c:1554)
    by 0x4C5E777: ei_create (libei.c:73)
    by 0x4C5E777: ei_create_context (libei.c:97)
    by 0x42994B: setup_ei (xwayland-xtest.c:366)
    by 0x42A383: xwayland_xtest_send_events (xwayland-xtest.c:658)
    by 0x54ED4C: ProcXTestFakeInput (xtest.c:441)
    by 0x54EE56: ProcXTestDispatch (xtest.c:475)
    by 0x4AD6E6: Dispatch (dispatch.c:546)
    by 0x4BBA0B: dix_main (main.c:272)
    by 0x43615D: main (stubmain.c:34)

To avoid that issue, make sure to cancel the timer as soon as a EI
client is freed.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
See-also: https://bugzilla.redhat.com/2243076
(cherry picked from commit 9617de733b)
2023-10-12 09:40:04 +02:00
.gitlab-ci meson: Change project name to xwayland 2023-07-18 12:52:07 +00:00
composite Drop Xorg DDX 2023-07-18 12:52:07 +00:00
damageext Remove autotools support 2021-10-27 13:15:40 +03:00
dbe Drop Xorg DDX 2023-07-18 12:52:07 +00:00
dix Drop config directory 2023-07-18 12:52:07 +00:00
doc Remove autotools support 2021-10-27 13:15:40 +03:00
dri3 Drop Xorg DDX 2023-07-18 12:52:07 +00:00
fb Drop Xorg DDX 2023-07-18 12:52:07 +00:00
glamor glamor: xv: Fix invalid accessing of plane attributes for NV12 2023-10-12 09:39:54 +02:00
glx Drop Xorg DDX 2023-07-18 12:52:07 +00:00
hw xwayland: Cancel the EI disconnect timer when freed 2023-10-12 09:40:04 +02:00
include Drop config directory 2023-07-18 12:52:07 +00:00
m4 Add ax_pthread.m4 to m4/ 2016-05-29 19:20:51 -07:00
man Disallow byte-swapped clients by default 2023-01-06 11:59:37 +10:00
mi mi: Fix up alpha channel if needed in miPaintWindow 2023-07-27 16:50:36 +02:00
miext Drop miext/shadow directory 2023-07-18 12:52:07 +00:00
os Allow disabling the SHAPE extension at runtime 2023-03-03 18:28:40 +00:00
present Drop Xorg DDX 2023-07-18 12:52:07 +00:00
randr Drop Xorg DDX 2023-07-18 12:52:07 +00:00
record record: Fix out of bounds access in SwapCreateRegister() 2021-12-14 15:00:00 +02:00
render Drop Xorg DDX 2023-07-18 12:52:07 +00:00
test Drop Xephyr / kdrive DDX 2023-07-18 12:52:07 +00:00
Xext xtest: Check whether there is a sendEventsProc to call 2023-09-19 11:14:59 +02:00
xfixes Remove "All rights reserved" from Oracle copyright notices 2023-02-25 09:40:41 -08:00
Xi Xi: fix potential use-after-free in DeepCopyPointerClasses 2023-02-07 10:07:18 +10:00
xkb ddxLoad: Check XDG_RUNTIME_DIR before fallback to /tmp/ 2023-04-06 00:48:12 +00:00
.appveyor.yml Drop Xephyr / kdrive DDX 2023-07-18 12:52:07 +00:00
.dir-locals.el .dir-locals.el: Add missing final newline 2019-10-01 17:05:28 +00:00
.gitignore .gitignore: Add new autotools file 'test-driver' 2014-04-21 13:41:42 -07:00
.gitlab-ci.yml Drop Xwin DDX and x86 MinGW-w64 cross build 2023-07-18 12:52:07 +00:00
.mailmap Add a .mailmap file to canonicalize author names and emails 2023-03-15 18:10:51 +00:00
COPYING modesetting: Merge modesetting's COPYING into the xserver's. 2014-09-15 12:46:02 -07:00
meson.build Bump version to 23.2.1 2023-09-20 10:10:03 +02:00
meson_options.txt meson: Build Xwayland unconditionally 2023-07-18 12:52:07 +00:00
README.md Fix spelling/wording issues 2020-07-05 13:07:33 -07: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