Blame SOURCES/0004-qxl-Initialize-prev-field-while-dup-surface-list.patch

45aa48
From e9ac0c029d04b84c45029f7d714e3412382c3d25 Mon Sep 17 00:00:00 2001
45aa48
From: Victor Toso <me@victortoso.com>
45aa48
Date: Tue, 23 Oct 2018 13:48:58 +0200
45aa48
Subject: [PATCH] qxl: Initialize prev field while dup surface list
45aa48
MIME-Version: 1.0
45aa48
Content-Type: text/plain; charset=UTF-8
45aa48
Content-Transfer-Encoding: 8bit
45aa48
45aa48
Otherwise we will can hit a segfault qxl_surface_kill()
45aa48
45aa48
 │717     void
45aa48
 │718     qxl_surface_kill (qxl_surface_t *surface)
45aa48
 │719     {
45aa48
 │720         struct evacuated_surface_t *ev = surface->evacuated;
45aa48
 │721
45aa48
 │722         if (ev)
45aa48
 │723         {
45aa48
 │724             /* server side surface is already destroyed (via reset), don't
45aa48
 │725              * resend a destroy. Just mark surface as not to be recreated */
45aa48
 │726             ev->pixmap = NULL;│
45aa48
 │727             if (ev->image)│
45aa48
 │728                 pixman_image_unref (ev->image);
45aa48
 │729             if (ev->next)
45aa48
 │730                 ev->next->prev = ev->prev;
45aa48
 │731             if (ev->prev)
45aa48
>│732                ev->prev->next = ev->next;
45aa48
 │733             free(ev);
45aa48
 │734             surface->evacuated = NULL;
45aa48
 │735             return;
45aa48
 │736         }
45aa48
45aa48
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1641793
45aa48
45aa48
Signed-off-by: Victor Toso <victortoso@redhat.com>
45aa48
(cherry picked from commit cf2254c13497049a8dbc73a3b031f4cd43403ab1)
45aa48
---
45aa48
 src/qxl_surface_ums.c | 1 +
45aa48
 1 file changed, 1 insertion(+)
45aa48
45aa48
diff --git a/src/qxl_surface_ums.c b/src/qxl_surface_ums.c
45aa48
index 2c16ede..19cbd36 100644
45aa48
--- a/src/qxl_surface_ums.c
45aa48
+++ b/src/qxl_surface_ums.c
45aa48
@@ -792,6 +792,7 @@ qxl_surface_cache_evacuate_all (surface_cache_t *cache)
45aa48
 
45aa48
 	unlink_surface (s);
45aa48
 	
45aa48
+	evacuated->prev = NULL;
45aa48
 	evacuated->next = evacuated_surfaces;
45aa48
         if (evacuated_surfaces)
45aa48
             evacuated_surfaces->prev = evacuated;
45aa48
-- 
45aa48
2.20.1
45aa48