mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-19 06:59:48 -05:00
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.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| backend | ||
| interfaces | ||
| render | ||
| types | ||
| util | ||
| wlr | ||
| xcursor | ||
| xwayland | ||
| meson.build | ||