summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2017-03-02 10:19:26 +0100
committerAdam Jackson <ajax@redhat.com>2017-03-06 18:37:16 -0500
commit64ca14b85e45b13628396f21d1903e311f92a9e1 (patch)
tree9d0a3128ac7e1b8bc5c7ce252be4d1751c967cc2
parent5c44169caed811e59a65ba346de1cadb46d266ec (diff)
xwayland: make sure client is not gone in sync callback
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>
-rw-r--r--hw/xwayland/xwayland-glamor.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index b3d0aab68..65c3c0024 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -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);
}