wlroots/xwayland
David Turner 879243e370 xwm: Fix double-close
When an FD is passed to xcb_connect_to_fd(), xcb takes ownership of that
FD and is responsible for closing it, which it does when
xcb_disconnect() is called.  But the xwayland handler code also keeps a
copy of the FD and closes it via safe_close() in
server_finish_process().

This double-close can cause all sorts of problems if another part of
wlroots allocates another FD between the two closes - the latter close
will close the wrong FD and things go horribly wrong (in my case leading
to use-after-free and segfaults).

Fix this by setting wm_fd[0]=-1 after calling xwm_create(), and ensuring
that xwm_create() closes the FD if startup errors occur.
2025-10-20 14:02:29 +01:00
..
selection xwayland/selection/dnd: always send finished event 2025-03-23 15:17:10 +01:00
meson.build xwayland: require xcb-xfixes 1.15 2025-06-16 07:40:04 +00:00
server.c Revert "xwayland: Reset signal mask and handlers before exec" 2025-04-20 21:12:33 +02:00
shell.c Assert (almost all) signals have no attached listeners on destroy 2025-01-15 19:53:11 +03:00
sockets.c Define _POSIX_C_SOURCE globally 2024-02-15 15:41:12 +01:00
sockets.h Add some missing includes/declarations 2023-06-05 21:06:19 +00:00
xwayland.c xwm: Fix double-close 2025-10-20 14:02:29 +01:00
xwm.c xwm: Fix double-close 2025-10-20 14:02:29 +01:00