From 3227e5fa6ad3c3f6d840d02f9ea435c21c109bf6 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Wed, 3 May 2023 03:41:41 +0200
Subject: [PATCH] Import Debian changes 2:21.1.7-3

---
 composite/compwindow.c |  5 +++++
 debian/changelog       | 16 ++++++++++++++++
 debian/rules.flags     |  2 +-
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/composite/compwindow.c b/composite/compwindow.c
index 73a1871..9a65163 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -620,6 +620,11 @@ compDestroyWindow(WindowPtr pWin)
     ret = (*pScreen->DestroyWindow) (pWin);
     cs->DestroyWindow = pScreen->DestroyWindow;
     pScreen->DestroyWindow = compDestroyWindow;
+
+    /* Did we just destroy the overlay window? */
+    if (pWin == cs->pOverlayWin)
+        cs->pOverlayWin = NULL;
+
 /*    compCheckTree (pWin->drawable.pScreen); can't check -- tree isn't good*/
     return ret;
 }
diff --git a/debian/changelog b/debian/changelog
index 0949487..93b489c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,19 @@
+xorg-server (2:21.1.7-3) unstable; urgency=medium
+
+  * Enable DRI2 for the udeb build, needed in addition to DRM support
+    since 9c81b8f5b5 to build the modesetting driver. This fixes failures
+    to start X in the graphical installer under UTM (Closes: #1035014).
+    Thanks to Keith Toh for the report and the follow-up tests!
+
+ -- Cyril Brulebois <kibi@debian.org>  Wed, 03 May 2023 03:41:41 +0200
+
+xorg-server (2:21.1.7-2) unstable; urgency=high
+
+  * composite: Fix use-after-free of the COW
+    ZDI-CAN-19866/CVE-2023-1393
+
+ -- Julien Cristau <jcristau@debian.org>  Wed, 29 Mar 2023 15:11:07 +0200
+
 xorg-server (2:21.1.7-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/debian/rules.flags b/debian/rules.flags
index 5102645..bd560e1 100644
--- a/debian/rules.flags
+++ b/debian/rules.flags
@@ -75,7 +75,7 @@ confflags_udeb = \
 	--disable-xdm-auth-1 \
 	--disable-glx \
 	--disable-dri \
-	--disable-dri2 \
+	--enable-dri2 \
 	--disable-glamor \
 	--disable-xinerama \
 	--disable-xf86vidmode \
-- 
GitLab