xorg-server: Changes to 'ubuntu'
debian/changelog | 24 ++++
debian/patches/169_mipointer_nullptr_checks.patch | 128 ++++++++++++++++++++++
debian/patches/170_primary_pci_video_device.patch | 108 ++++++++++++++++++
debian/patches/series | 6 -
4 files changed, 264 insertions(+), 2 deletions(-)
New commits:
commit ca902d950ac6eed9d56201d2ed88b41c5c0a76da
Author: Timo Aaltonen <tjaalton@cc.hut.fi>
Date: Fri Mar 27 16:33:38 2009 +0200
Apply changes from 0ubuntu5
diff --git a/debian/changelog b/debian/changelog
index 4b1dc0e..5dcde04 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,27 @@
+xorg-server (2:1.6.0-0ubuntu5) jaunty; urgency=low
+
+ [Tormod Volden]
+ * Disable 160_log_timestamping.patch before the beta, this was only used
+ for testing, and the patch also has a serious stack corruption bug.
+ (LP: #328035)
+
+ [Bryce Harrington]
+ * Disable 999_default_modedebug_on.patch before the beta, this was used
+ only for testing.
+ * Add 169_mipointer_nullptr_checks.patch:
+ - MIPOINTER() can return NULL in some circumstances, so always check
+ its return value before dereferencing.
+ - Fixes crash with keyrepeat on non-primary screen on -nvidia when
+ using Xinerama (and probably other serious mipointer-related crashes)
+ (LP: #324465)
+ * Add 170_primary_pci_video_device.patch:
+ - Patch from redhat
+ - Fixes failure when multiple video cards are present. Xserver currently
+ exits with an error "(EE) No device detected" in such cases.
+ (LP: #267241)
+
+ -- Bryce Harrington <bryce@ubuntu.com> Tue, 24 Mar 2009 09:57:17 -0700
+
xorg-server (2:1.6.0-0ubuntu4) jaunty; urgency=low
* Add 168_glibc_trace_to_stderr.patch:
diff --git a/debian/patches/169_mipointer_nullptr_checks.patch b/debian/patches/169_mipointer_nullptr_checks.patch
new file mode 100644
index 0000000..7565133
--- /dev/null
+++ b/debian/patches/169_mipointer_nullptr_checks.patch
@@ -0,0 +1,128 @@
+From 179cec1d2f919d8d8096d6030b0ad9b6285dfd4d Mon Sep 17 00:00:00 2001
+From: Bryce Harrington <bryce@bryceharrington.org>
+Date: Mon, 23 Mar 2009 14:25:18 -0700
+Subject: [PATCH] Check null pointers to not crash on keyrepeat with Xinerama LP: (#324465)
+
+With -nvidia, when using Xinerama, holding down a key in a text field
+on a non-primary screen can cause an X crash. This is caused because
+the MIPOINTER(pDev) can return a NULL pointer for a non-null pDev in
+some cases, and the mipointer.c code lacks checks for this condition.
+
+MIPOINTER() is a macro #defined locally to mipointer.c, which calls into
+dixLookupPrivate(), a routine which returns NULL in at least some
+circumstances - such as if the memory could not be xcalloc'd for
+whatever reason. Hopefully upstream can provide a better fix for this,
+but for now it seems reasonable to check the return values of this macro
+for NULL before usage, as a minimum.
+
+Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
+---
+ mi/mipointer.c | 38 ++++++++++++++++++++++++++++++++++++--
+ 1 files changed, 36 insertions(+), 2 deletions(-)
+
+diff --git a/mi/mipointer.c b/mi/mipointer.c
+index e37316e..ed0c48c 100644
+--- a/mi/mipointer.c
++++ b/mi/mipointer.c
+@@ -140,6 +140,10 @@ miPointerCloseScreen (int index, ScreenPtr pScreen)
+ if (DevHasCursor(pDev))
+ {
+ pPointer = MIPOINTER(pDev);
++ if (pPointer == NULL) {
++ ErrorF("miPointerCloseScreen: Invalid input device pointer\n");
++ return FALSE;
++ }
+
+ if (pScreen == pPointer->pScreen)
+ pPointer->pScreen = 0;
+@@ -192,6 +196,10 @@ miPointerDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
+ return FALSE;
+
+ pPointer = MIPOINTER(pDev);
++ if (pPointer == NULL) {
++ ErrorF("miPointerDisplayCursor: Invalid input device pointer\n");
++ return FALSE;
++ }
+
+ pPointer->pCursor = pCursor;
+ pPointer->pScreen = pScreen;
+@@ -205,6 +213,10 @@ miPointerConstrainCursor (DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pBox)
+ miPointerPtr pPointer;
+
+ pPointer = MIPOINTER(pDev);
++ if (pPointer == NULL) {
++ ErrorF("miPointerConstrainCursor: Invalid input device pointer\n");
++ return FALSE;
++ }
+
+ pPointer->limits = *pBox;
+ pPointer->confined = PointerConfinedToScreen(pDev);
+@@ -304,6 +316,11 @@ miPointerWarpCursor (DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
+ BOOL changedScreen = FALSE;
+
+ pPointer = MIPOINTER(pDev);
++ if (pPointer == NULL) {
++ ErrorF("miPointerWarpCursor: Invalid input device pointer\n");
++ return;
++ }
++
+ SetupScreen (pScreen);
+
+ if (pPointer->pScreen != pScreen)
+@@ -366,6 +383,10 @@ miPointerUpdateSprite (DeviceIntPtr pDev)
+ return;
+
+ pPointer = MIPOINTER(pDev);
++ if (pPointer == NULL) {
++ ErrorF("miPointerUpdateSprite: Invalid input device pointer\n");
++ return;
++ }
+
+ pScreen = pPointer->pScreen;
+ if (!pScreen)
+@@ -433,13 +454,17 @@ miPointerSetScreen(DeviceIntPtr pDev, int screen_no, int x, int y)
+ ScreenPtr pScreen;
+ miPointerPtr pPointer;
+
+- pPointer = MIPOINTER(pDev);
+-
+ pScreen = screenInfo.screens[screen_no];
+ pScreenPriv = GetScreenPrivate (pScreen);
+ (*pScreenPriv->screenFuncs->NewEventScreen) (pDev, pScreen, FALSE);
+ NewCurrentScreen (pDev, pScreen, x, y);
+
++ pPointer = MIPOINTER(pDev);
++ if (pPointer == NULL) {
++ ErrorF("miPointerSetScreen: Invalid input device pointer\n");
++ return;
++ }
++
+ pPointer->limits.x2 = pScreen->width;
+ pPointer->limits.y2 = pScreen->height;
+ }
+@@ -475,6 +500,10 @@ miPointerMoved (DeviceIntPtr pDev, ScreenPtr pScreen,
+ SetupScreen(pScreen);
+
+ pPointer = MIPOINTER(pDev);
++ if (pPointer == NULL) {
++ ErrorF("miPointerMoved: Invalid input device pointer\n");
++ return;
++ }
+
+ /* Hack: We mustn't call into ->MoveCursor for anything but the
+ * VCP, as this may cause a non-HW rendered cursor to be rendered during
+@@ -504,6 +533,11 @@ miPointerSetPosition(DeviceIntPtr pDev, int *x, int *y)
+ miPointerPtr pPointer;
+
+ pPointer = MIPOINTER(pDev);
++ if (pPointer == NULL) {
++ ErrorF("miPointerSetPosition: Invalid input device pointer\n");
++ return;
++ }
++
+ pScreen = pPointer->pScreen;
+ if (!pScreen)
+ return; /* called before ready */
+--
+1.6.0.4
+
diff --git a/debian/patches/170_primary_pci_video_device.patch b/debian/patches/170_primary_pci_video_device.patch
new file mode 100644
index 0000000..f410e11
--- /dev/null
+++ b/debian/patches/170_primary_pci_video_device.patch
@@ -0,0 +1,108 @@
+From 69e53f2493c142ef5569af01ce52565be5b2976e Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 3 Mar 2009 10:58:33 -0500
+Subject: [PATCH] Primary video device hack
+
+---
+ hw/xfree86/common/xf86pciBus.c | 60 ++++++++++++++++++++++++++++++++--------
+ 1 files changed, 48 insertions(+), 12 deletions(-)
+
+diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
+index 467a0c3..0d2d01c 100644
+--- a/hw/xfree86/common/xf86pciBus.c
++++ b/hw/xfree86/common/xf86pciBus.c
+@@ -60,11 +60,7 @@ static struct pci_device ** xf86PciVideoInfo = NULL; /* PCI probe for video hw *
+ /* PCI classes that get included in xf86PciVideoInfo */
+ #define PCIINFOCLASSES(c) \
+ ( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \
+- || (((c) & 0x00ff0000) == (PCI_CLASS_DISPLAY << 16)) \
+- || ((((c) & 0x00ffff00) \
+- == ((PCI_CLASS_MULTIMEDIA << 16) | (PCI_SUBCLASS_MULTIMEDIA_VIDEO << 8)))) \
+- || ((((c) & 0x00ffff00) \
+- == ((PCI_CLASS_PROCESSOR << 16) | (PCI_SUBCLASS_PROCESSOR_COPROC << 8)))) )
++ || (((c) & 0x00ffff00) == (PCI_CLASS_DISPLAY << 16)) )
+
+ /*
+ * PCI classes that have messages printed always. The others are only
+@@ -341,6 +337,39 @@ restorePciBusState(BusAccPtr ptr)
+ }
+ #undef MASKBITS
+
++/* oh god what have i done */
++static Bool
++looks_like_bios_primary(struct pci_device *info)
++{
++ unsigned char *bios;
++ unsigned short vendor, device;
++ int offset;
++ Bool ret = FALSE;
++
++ bios = xf86MapVidMem(-1, VIDMEM_MMIO, 0xc0000, 0x10000);
++ if (!bios)
++ return FALSE;
++
++ if (bios[0] != 0x55 || bios[1] != 0xAA)
++ goto out;
++
++ offset = (bios[0x19] << 8) + bios[0x18];
++
++ if (bios[offset] != 'P' ||
++ bios[offset+1] != 'C' ||
++ bios[offset+2] != 'I' ||
++ bios[offset+3] != 'R')
++ goto out;
++
++ vendor = (bios[offset+5] << 8) + bios[offset+4];
++ device = (bios[offset+7] << 8) + bios[offset+6];
++
++ ret = (info->vendor_id == vendor) && (info->device_id == device);
++
++out:
++ xf86UnMapVidMem(-1, bios, 0x10000);
++ return ret;
++}
+
+ /*
+ * xf86Bus.c interface
+@@ -375,24 +404,31 @@ xf86PciProbe(void)
+ }
+ }
+
+-
+ /* If we haven't found a primary device try a different heuristic */
+ if (primaryBus.type == BUS_NONE && num) {
+ for (i = 0; i < num; i++) {
+ uint16_t command;
+
+ info = xf86PciVideoInfo[i];
++ if (!IS_VGA(info->device_class))
++ continue;
++
+ pci_device_cfg_read_u16(info, & command, 4);
+
+- if ((command & PCI_CMD_MEM_ENABLE)
+- && ((num == 1) || IS_VGA(info->device_class))) {
+- if (primaryBus.type == BUS_NONE) {
++ if ((command & PCI_CMD_MEM_ENABLE)) {
++ if (num == 1) {
+ primaryBus.type = BUS_PCI;
+ primaryBus.id.pci = info;
+- } else {
+- xf86Msg(X_NOTICE,
++ break;
++ } else if (looks_like_bios_primary(info)) {
++ if (primaryBus.type == BUS_NONE) {
++ primaryBus.type = BUS_PCI;
++ primaryBus.id.pci = info;
++ } else {
++ xf86Msg(X_NOTICE,
+ "More than one possible primary device found\n");
+- primaryBus.type ^= (BusType)(-1);
++ primaryBus.type ^= (BusType)(-1);
++ }
+ }
+ }
+ }
+--
+1.6.1.3
+
diff --git a/debian/patches/series b/debian/patches/series
index d709691..27cb6ef 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,12 +16,14 @@
156_exevents_copykeyclass_nullptrcheck.patch
157_check_null_modes.patch
#158_raise_maxclients.patch
-160_log_timestamping.patch
+#160_log_timestamping.patch
162_null_crtc_in_rotation.patch
-999_default_modedebug_on.patch
163_thinko_in_xf86targetpreferred.patch
164_trap-aspect-ratios.patch
165_man_xorg_conf_no_device_ident.patch
166_nullptr_xinerama_keyrepeat.patch
167_nullptr_xisbread.patch
168_glibc_trace_to_stderr.patch
+169_mipointer_nullptr_checks.patch
+#999_default_modedebug_on.patch
+170_primary_pci_video_device.patch
Reply to: