From cad831f39861435cb94f4c90a73f7f0b62d1a4a1 Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Wed, 6 May 2015 15:07:21 +1200 Subject: [PATCH 1/6] xwayland: Fix error strings Fix missing newlines from error string and fix grammar. Signed-off-by: Robert Ancell Reviewed-by: Daniel Stone --- hw/xwayland/xwayland-glamor.c | 4 ++-- hw/xwayland/xwayland-input.c | 2 +- hw/xwayland/xwayland-output.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index d06006c70..6b6e59756 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -310,7 +310,7 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen) } if (!epoxy_has_gl_extension("GL_OES_EGL_image")) { - ErrorF("GL_OES_EGL_image no available"); + ErrorF("GL_OES_EGL_image not available\n"); return; } @@ -329,7 +329,7 @@ xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device) xwl_screen->drm_fd = open(xwl_screen->device_name, O_RDWR | O_CLOEXEC); if (xwl_screen->drm_fd == -1) { - ErrorF("wayland-egl: could not open %s (%s)", + ErrorF("wayland-egl: could not open %s (%s)\n", xwl_screen->device_name, strerror(errno)); return; } diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index cc3bc53c8..488b839d3 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -561,7 +561,7 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id) xwl_seat = calloc(sizeof *xwl_seat, 1); if (xwl_seat == NULL) { - ErrorF("create_input ENOMEM"); + ErrorF("create_input ENOMEM\n"); return; } diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 778914c61..155cbc109 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -159,7 +159,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) xwl_output = calloc(sizeof *xwl_output, 1); if (xwl_output == NULL) { - ErrorF("create_output ENOMEM"); + ErrorF("create_output ENOMEM\n"); return NULL; } @@ -168,7 +168,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) wl_output_add_listener(xwl_output->output, &output_listener, xwl_output); if (snprintf(name, sizeof name, "XWAYLAND%d", serial++) < 0) { - ErrorF("create_output ENOMEM"); + ErrorF("create_output ENOMEM\n"); free(xwl_output); return NULL; } From 28159eff6badf6181b255f26d1f444abe81c05b7 Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Thu, 30 Apr 2015 18:06:14 -0700 Subject: [PATCH 2/6] xfree86: Return NULL from xf86CompatOutput if no compat_output is defined If no compat_output is defined, we inadvertently (attempt to) return whatever data is at index -1. Instead, return NULL since that's what callers are expecting. Reviewed-by: Adam Jackson Signed-off-by: Jason Gerecke --- hw/xfree86/modes/xf86Crtc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 3c5bbcfd5..8b0160845 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -745,6 +745,8 @@ xf86CompatOutput(ScrnInfoPtr pScrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + if (config->compat_output < 0) + return NULL; return config->output[config->compat_output]; } From 1af15aaf278edcf6f6de94774350e34a80883c24 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 10 Apr 2015 10:07:38 +0200 Subject: [PATCH 3/6] dix: Fix image byte order on big endian hardware Make sure X_BIG_ENDIAN/X_LITTLE_ENDIAN are defined before actually using them. Otherwise, image byte order could be wrong on big endian hardware even though endianess detection is correct. Reported-by: Tim Waugh Signed-off-by: Olivier Fourdan Reviewed-by: Adam Jackson --- include/servermd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/servermd.h b/include/servermd.h index a3b5c3af3..087826f48 100644 --- a/include/servermd.h +++ b/include/servermd.h @@ -52,6 +52,8 @@ SOFTWARE. #error xserver code must include dix-config.h before any other headers #endif +#include /* for X_LITTLE_ENDIAN/X_BIG_ENDIAN */ + #if X_BYTE_ORDER == X_LITTLE_ENDIAN #define IMAGE_BYTE_ORDER LSBFirst #define BITMAP_BIT_ORDER LSBFirst From d61ae18074e53c2cdfb13cc37693b526160d6ca7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 4 Mar 2015 12:16:29 +0000 Subject: [PATCH 4/6] glx/dri2: Disable AIGLX if indirect GLX is disabled There is no point in setting up the acceleration for indirect GLX if indirect GLX is itself disabled. Reviewed-by: Adam Jackson Signed-off-by: Chris Wilson --- glx/glxdri2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glx/glxdri2.c b/glx/glxdri2.c index bcd57a4a3..c0f29ea31 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -936,6 +936,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) size_t buffer_size; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + if (!enableIndirectGLX) + return NULL; + screen = calloc(1, sizeof *screen); if (screen == NULL) return NULL; From bcec9f867d19e954a46c2654a79782bff6c65fce Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 14 Feb 2015 10:36:44 +0000 Subject: [PATCH 5/6] shm: Fix use-after-free in ShmDestroyPixmap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We pass the pPixmap->drawable.id to the ShmDetachSegment function after the pPixmap is freed. Fortunately, we don't use the value inside ShmDetachSegment and can simply pass zero instead. Signed-off-by: Chris Wilson Reviewed-by: Michel Dänzer --- Xext/shm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Xext/shm.c b/Xext/shm.c index db9d47450..52d997425 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -260,7 +260,7 @@ ShmDestroyPixmap(PixmapPtr pPixmap) pScreen->DestroyPixmap = ShmDestroyPixmap; if (shmdesc) - ShmDetachSegment(shmdesc, pPixmap->drawable.id); + ShmDetachSegment(shmdesc, 0); return ret; } @@ -427,7 +427,7 @@ ProcShmAttach(ClientPtr client) /*ARGSUSED*/ static int ShmDetachSegment(void *value, /* must conform to DeleteType */ - XID shmseg) + XID unused) { ShmDescPtr shmdesc = (ShmDescPtr) value; ShmDescPtr *prev; From 7470578520e90b6402b2509cd0c51fd4fd84849f Mon Sep 17 00:00:00 2001 From: Brent Collins Date: Thu, 7 May 2015 15:10:19 -0400 Subject: [PATCH 6/6] shm: Fix xselinux resource initialization for xinerama pixmaps This is necessary to avoid a NULL pointer deference when the pixmap is used later. [ajax: massaged commit message, fixed it to compile] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89748 Reviewed-by: Adam Jackson Signed-off-by: Brent Collins --- Xext/shm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Xext/shm.c b/Xext/shm.c index 52d997425..b359a9035 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -971,6 +971,12 @@ ProcPanoramiXShmCreatePixmap(ClientPtr client) stuff->offset); if (pMap) { + result = XaceHook(XACE_RESOURCE_ACCESS, client, stuff->pid, + RT_PIXMAP, pMap, RT_NONE, NULL, DixCreateAccess); + if (result != Success) { + pDraw->pScreen->DestroyPixmap(pMap); + return result; + } dixSetPrivate(&pMap->devPrivates, shmPixmapPrivateKey, shmdesc); shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;