[xorg-x11-drv-qxl] - Don't access the qxl device when our vt is not focussed, this fixes Xorg crashing when switching

Hans de Goede jwrdegoede at fedoraproject.org
Mon Oct 11 11:17:17 UTC 2010


commit 0ac9e30e22362545bf08ae899a3b4413927b2e64
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Mon Oct 11 13:20:00 2010 +0200

    - Don't access the qxl device when our vt is not focussed, this fixes
      Xorg crashing when switching to a text vc

 ...s-the-qxl-device-when-our-vt-is-not-focus.patch |   49 ++++++++++++++++++++
 xorg-x11-drv-qxl.spec                              |    8 +++-
 2 files changed, 56 insertions(+), 1 deletions(-)
---
diff --git a/0007-Don-t-access-the-qxl-device-when-our-vt-is-not-focus.patch b/0007-Don-t-access-the-qxl-device-when-our-vt-is-not-focus.patch
new file mode 100644
index 0000000..b11f965
--- /dev/null
+++ b/0007-Don-t-access-the-qxl-device-when-our-vt-is-not-focus.patch
@@ -0,0 +1,49 @@
+From 5984c6d5ebc8b66edc29a7cb8e5921e55484670c Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede at redhat.com>
+Date: Mon, 11 Oct 2010 13:11:25 +0200
+Subject: [PATCH xf86-drv-qxl F14-branch 7/7] Don't access the qxl device when our vt is not focussed
+
+Trying to do so causes the X-server to segfault as it has
+dropped iopl permission, which is, erm, undesirable :)
+---
+ src/qxl.h         |    6 +-----
+ src/qxl_surface.c |    4 ++++
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/qxl.h b/src/qxl.h
+index e126546..0f9927b 100644
+--- a/src/qxl.h
++++ b/src/qxl.h
+@@ -697,11 +697,7 @@ struct _qxl_screen_t
+ static inline Bool
+ in_vga_mode (qxl_screen_t *qxl)
+ {
+-    /* FIXME: The ability to detect whether we are in VGA
+-     * mode has been remvoed in newer devices.
+-     */
+-    
+-    return FALSE;
++    return !qxl->pScrn->vtSema;
+ }
+ 
+ static uint64_t
+diff --git a/src/qxl_surface.c b/src/qxl_surface.c
+index 3b177fe..23ec1fe 100644
+--- a/src/qxl_surface.c
++++ b/src/qxl_surface.c
+@@ -439,8 +439,12 @@ qxl_surface_prepare_access (qxl_surface_t  *surface,
+     int n_boxes;
+     BoxPtr boxes;
+     ScreenPtr pScreen = pixmap->drawable.pScreen;
++    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+     RegionRec new;
+ 
++    if (!pScrn->vtSema)
++        return FALSE;
++
+     REGION_INIT (NULL, &new, (BoxPtr)NULL, 0);
+     REGION_SUBTRACT (NULL, &new, region, &surface->access_region);
+ 
+-- 
+1.7.2.2
+
diff --git a/xorg-x11-drv-qxl.spec b/xorg-x11-drv-qxl.spec
index 5698608..034de49 100644
--- a/xorg-x11-drv-qxl.spec
+++ b/xorg-x11-drv-qxl.spec
@@ -5,7 +5,7 @@
 Summary:   Xorg X11 qxl video driver
 Name:      xorg-x11-drv-qxl
 Version:   0.0.20.f14b
-Release:   4%{?dist}
+Release:   5%{?dist}
 URL:       http://www.x.org
 Source0:   http://xorg.freedesktop.org/releases/individual/driver/%{tarball}-%{version}.tar.bz2
 License: MIT
@@ -26,6 +26,7 @@ Patch3:  0003-Change-default-virtual-size-to-match-the-highest-ava.patch
 Patch4:  0004-Fix-restoration-of-text-mode-font-when-leaving-the-v.patch
 Patch5:  0005-Slightly-tweak-the-vfresh-range-of-the-default-monit.patch
 Patch6:  0006-limit-calculated-virtual-size-to-fit-within-the-fram.patch
+Patch7:  0007-Don-t-access-the-qxl-device-when-our-vt-is-not-focus.patch
 
 
 %description 
@@ -40,6 +41,7 @@ X.Org X11 qxl video driver.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %build
 %configure --disable-static
@@ -63,6 +65,10 @@ rm -rf $RPM_BUILD_ROOT
 %{driverdir}/qxl_drv.so
 
 %changelog
+* Mon Oct 11 2010 Hans de Goede <hdegoede at redhat.com> 0.0.20.f14b-5
+- Don't access the qxl device when our vt is not focussed, this fixes
+  Xorg crashing when switching to a text vc
+
 * Sun Oct 10 2010 Hans de Goede <hdegoede at redhat.com> 0.0.20.f14b-4
 - Fix the driver not working on qxl devices with a framebuffer of 8MB
 


More information about the scm-commits mailing list