1
0

Accepting request 128078 from X11:XOrg

- renamed patches of previous change according to our policy
  u_* --> U_* (since these were rebased on upstream patches) 

- Add patches u_dri2_add_DRI2CreateDrawable2.patch and 
  u_0012-glx_Free_reference_to_destroyed_GLX_drawable.patch to fix
  seemingly random crashes of the X stack [bnc#769553]; patches
  came from upstream git commits, and were rebased to apply to
  present version cleanly.

OBS-URL: https://build.opensuse.org/request/show/128078
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xorg-x11-server?expand=0&rev=242
This commit is contained in:
Stephan Kulow 2012-07-18 15:53:12 +00:00 committed by Git OBS Bridge
commit cde4b5d1a6
4 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,66 @@
From 8a87acc9e57be740e3bd252567622246051a0723 Mon Sep 17 00:00:00 2001
From: Michel Dänzer <michel.daenzer@amd.com>
Date: Thu, 12 Jul 2012 11:16:36 +0000
Subject: dri2: Add DRI2CreateDrawable2.
Same as DRI2CreateDrawable, except it can return the DRI2 specific XID of the
DRI2 drawable reference to the base drawable.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
---
Index: xorg-server-1.12.3/hw/xfree86/dri2/dri2.c
===================================================================
--- xorg-server-1.12.3.orig/hw/xfree86/dri2/dri2.c
+++ xorg-server-1.12.3/hw/xfree86/dri2/dri2.c
@@ -280,8 +280,9 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv
}
int
-DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
- DRI2InvalidateProcPtr invalidate, void *priv)
+DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id,
+ DRI2InvalidateProcPtr invalidate, void *priv,
+ XID *dri2_id_out)
{
DRI2DrawablePtr pPriv;
XID dri2_id;
@@ -298,9 +299,19 @@ DRI2CreateDrawable(ClientPtr client, Dra
if (rc != Success)
return rc;
+ if (dri2_id_out)
+ *dri2_id_out = dri2_id;
+
return Success;
}
+int
+DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id,
+ DRI2InvalidateProcPtr invalidate, void *priv)
+{
+ return DRI2CreateDrawable2(client, pDraw, id, invalidate, priv, NULL);
+}
+
static int
DRI2DrawableGone(pointer p, XID id)
{
Index: xorg-server-1.12.3/hw/xfree86/dri2/dri2.h
===================================================================
--- xorg-server-1.12.3.orig/hw/xfree86/dri2/dri2.h
+++ xorg-server-1.12.3/hw/xfree86/dri2/dri2.h
@@ -237,6 +237,13 @@ extern _X_EXPORT int DRI2CreateDrawable(
extern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw);
+extern _X_EXPORT int DRI2CreateDrawable2(ClientPtr client,
+ DrawablePtr pDraw,
+ XID id,
+ DRI2InvalidateProcPtr invalidate,
+ void *priv,
+ XID *dri2_id_out);
+
extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw,
int *width,
int *height,

View File

@ -0,0 +1,47 @@
From a2d0829531249e24dbca25fc20ed30a2bb2d8ed8 Mon Sep 17 00:00:00 2001
From: Michel Dänzer <michel.daenzer@amd.com>
Date: Thu, 12 Jul 2012 11:16:37 +0000
Subject: glx: Free DRI2 drawable reference to destroyed GLX drawable.
Otherwise the reference can lead to use after free in
__glXDRIinvalidateBuffers().
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50019
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
---
Index: xorg-server-1.12.3/glx/glxdri2.c
===================================================================
--- xorg-server-1.12.3.orig/glx/glxdri2.c
+++ xorg-server-1.12.3/glx/glxdri2.c
@@ -96,6 +96,7 @@ struct __GLXDRIdrawable {
int height;
__DRIbuffer buffers[MAX_DRAWABLE_BUFFERS];
int count;
+ XID dri2_id;
};
static void
@@ -104,6 +105,8 @@ __glXDRIdrawableDestroy(__GLXdrawable *
__GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable;
const __DRIcoreExtension *core = private->screen->core;
+ FreeResource(private->dri2_id, FALSE);
+
(*core->destroyDrawable) (private->driDrawable);
__glXDrawableRelease(drawable);
@@ -597,8 +600,9 @@ __glXDRIscreenCreateDrawable(ClientPtr c
private->base.waitGL = __glXDRIdrawableWaitGL;
private->base.waitX = __glXDRIdrawableWaitX;
- if (DRI2CreateDrawable(client, pDraw, drawId,
- __glXDRIinvalidateBuffers, private)) {
+ if (DRI2CreateDrawable2(client, pDraw, drawId,
+ __glXDRIinvalidateBuffers, private,
+ &private->dri2_id)) {
free(private);
return NULL;
}

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Tue Jul 17 01:42:30 UTC 2012 - sndirsch@suse.com
- renamed patches of previous change according to our policy
u_* --> U_* (since these were rebased on upstream patches)
-------------------------------------------------------------------
Fri Jul 13 00:19:59 UTC 2012 - badshah400@gmail.com
- Add patches u_dri2_add_DRI2CreateDrawable2.patch and
u_0012-glx_Free_reference_to_destroyed_GLX_drawable.patch to fix
seemingly random crashes of the X stack [bnc#769553]; patches
came from upstream git commits, and were rebased to apply to
present version cleanly.
-------------------------------------------------------------------
Mon Jul 9 21:28:59 UTC 2012 - tobias.johannes.klausmann@mni.thm.de

View File

@ -184,6 +184,8 @@ Patch213: xorg-server-xdmcp.patch
Patch220: Use-external-tool-for-creating-backtraces-on-crashes.patch
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch222: sync-fix.patch
Patch223: U_glx_Free_reference_to_destroyed_GLX_drawable.patch
Patch224: U_dri2_add_DRI2CreateDrawable2.patch
# Patches to implement GLX_ARB_create_context extensions required for OpenGL 3.0 support
# http://lists.x.org/archives/xorg-devel/2012-April/030452.html
# git://people.freedesktop.org/~idr/xserver.git
@ -320,6 +322,8 @@ cp %{SOURCE96} .
### Disable backtrace generation patch for now
#%patch220 -p1
%patch222 -p1
%patch223 -p1
%patch224 -p1
%patch300 -p1
%patch301 -p1
%patch302 -p1