From 8154d80a4d39e03c1ccc80b9a2e8a04b40a2091e Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 22 May 2026 20:05:17 +0200 Subject: [PATCH] xwayland/xwm: check whether surface is already associated for WL_SURFACE_ID xwayland_surface_associate() asserts that the surface has not yet been associated yet. Arbitrary clients can send these messages, don't abort when that happens. --- xwayland/xwm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index a5489b464..59c37db48 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1466,6 +1466,11 @@ static void xwm_handle_surface_id_message(struct wlr_xwm *xwm, ev->window); return; } + if (xsurface->surface != NULL) { + wlr_log(WLR_DEBUG, "Received multiple client messages WL_SURFACE_ID " + "for an already-associated X11 window %u", ev->window); + return; + } uint32_t id = ev->data.data32[0];