From: Marc-André Lureau <[email protected]>
Eliminates the undefined behavior where virtio-gpu's memcpy() overwrites
the buffer that an in-flight gvariant still references. Fixes the data
race where the GDBus worker thread calls cursor_unref() concurrently
with main thread.
Fixes: 142ca628a733 ("ui: add a D-Bus display backend")
Signed-off-by: Marc-André Lureau <[email protected]>
---
ui/dbus-listener.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
index 2e2f6ba4183a..a916479044ea 100644
--- a/ui/dbus-listener.c
+++ b/ui/dbus-listener.c
@@ -899,13 +899,11 @@ static void dbus_cursor_define(DisplayChangeListener *dcl,
ddl_discard_cursor_messages(ddl);
- v_data = g_variant_new_from_data(
- G_VARIANT_TYPE("ay"),
+ v_data = g_variant_new_fixed_array(
+ G_VARIANT_TYPE_BYTE,
c->data,
c->width * c->height * 4,
- TRUE,
- (GDestroyNotify)cursor_unref,
- cursor_ref(c));
+ 1);
qemu_dbus_display1_listener_call_cursor_define(
ddl->proxy,
--
2.55.0.543.g5ebe2ebe4ea8