Skip to content

Commit

Permalink
xwayland: make sure client is not gone in sync callback
Browse files Browse the repository at this point in the history
in XWayland, dri3_send_open_reply() is called from a sync callback, so
there is a possibility that the client might be gone when we get to the
callback eventually, which leads to a crash in _XSERVTransSendFd() from
WriteFdToClient() .

Check if clientGone has been set in the sync callback handler to avoid
this.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99149
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100040
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1416553
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Tested-by: Mark B <mark.blakeney@bullet-systems.net>
  • Loading branch information
ofourdan authored and nwnk committed Mar 6, 2017
1 parent 5c44169 commit 64ca14b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hw/xwayland/xwayland-glamor.c
Expand Up @@ -435,9 +435,12 @@ static void
sync_callback(void *data, struct wl_callback *callback, uint32_t serial)
{
struct xwl_auth_state *state = data;
ClientPtr client = state->client;

dri3_send_open_reply(state->client, state->fd);
AttendClient(state->client);
if (!client->clientGone) {
dri3_send_open_reply(client, state->fd);
AttendClient(client);
}
free(state);
wl_callback_destroy(callback);
}
Expand Down

0 comments on commit 64ca14b

Please sign in to comment.