xserver: Branch 'server-1.13-branch' - 5 commits

Peter Hutterer whot at kemper.freedesktop.org
Tue Apr 16 22:56:27 PDT 2013


 configure.ac                             |    6 +++---
 dix/window.c                             |    4 ++++
 hw/kdrive/ephyr/ephyr.c                  |    6 ++----
 hw/kdrive/ephyr/hostx.c                  |    6 +++++-
 hw/kdrive/ephyr/hostx.h                  |    3 ++-
 hw/xfree86/common/xf86Events.c           |    4 ++--
 hw/xfree86/os-support/shared/posix_tty.c |    3 ++-
 include/input.h                          |    5 +++++
 xfixes/cursor.c                          |   10 ++--------
 9 files changed, 27 insertions(+), 20 deletions(-)

New commits:
commit 10c42f5752d790f745572a3f9fbd2ad7686e1372
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Apr 17 15:50:48 2013 +1000

    xserver 1.13.4
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index b28d8e3..ad06e7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,9 +26,9 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.13.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2013-03-07"
-RELEASE_NAME="Golden Needle"
+AC_INIT([xorg-server], 1.13.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2013-04-17"
+RELEASE_NAME="Pokey Stick"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
commit 8039b6b7a31f6cf75fcbe4e472d8e9544808396c
Author: Dave Airlie <airlied at gmail.com>
Date:   Wed Apr 10 16:09:01 2013 +1000

    xf86: fix flush input to work with Linux evdev devices.
    
    So when we VT switch back and attempt to flush the input devices,
    we don't succeed because evdev won't return part of an event,
    since we were only asking for 4 bytes, we'd only get -EINVAL back.
    
    This could later cause events to be flushed that we shouldn't have
    gotten.
    
    This is a fix for CVE-2013-1940.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 6ca03b9161d33b1d2b55a3a1a913cf88deb2343f)

diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
index ab3757a..4d08c1e 100644
--- a/hw/xfree86/os-support/shared/posix_tty.c
+++ b/hw/xfree86/os-support/shared/posix_tty.c
@@ -421,7 +421,8 @@ xf86FlushInput(int fd)
 {
     fd_set fds;
     struct timeval timeout;
-    char c[4];
+    /* this needs to be big enough to flush an evdev event. */
+    char c[256];
 
     DebugF("FlushingSerial\n");
     if (tcflush(fd, TCIFLUSH) == 0)
commit 87d7e3e3525a9bcfa08d64ee2a83341e19140db7
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Dec 18 14:12:40 2012 +1000

    dix: only show the cursor if a window defines one (#58398)
    
    e02f864fdf "Suppress cursor display until the first XDefineCursor() request"
    disabled cursor display a priori unless -retro is given.
    
    On a plain server, caling XFixesHideCursor() and XFixesShowCursor() would
    show the default root cursor, despite no client actually defining a cursor.
    
    Change the logic, disable CursorVisible by default and only enable it from
    the window's CWCursor logic. If no window ever defines a cursor, said cursor
    stays invisible.
    
    X.Org Bug 58398 <http://bugs.freedesktop.org/show_bug.cgi?id=58398>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Bastien Nocera <hadess at hadess.net>
    Reviewed-by: Daniel Martin <consume.noise at gmail.com>
    (cherry picked from commit c100211034ab69ce453a1644fb61c6808d7e3eda)

diff --git a/dix/window.c b/dix/window.c
index 49ef4a0..ff979d9 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -1431,6 +1431,8 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
                     }
                 }
 
+                CursorVisible = TRUE;
+
                 if (pWin->realized)
                     WindowHasNewCursor(pWin);
 
@@ -3467,6 +3469,8 @@ ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor)
     }
 
  out:
+    CursorVisible = TRUE;
+
     if (pWin->realized)
         WindowHasNewCursor(pWin);
 
diff --git a/include/input.h b/include/input.h
index f0196f5..076e2c5 100644
--- a/include/input.h
+++ b/include/input.h
@@ -628,6 +628,11 @@ extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
    xfixes/cursor.c uses it to determine if the cursor is enabled */
 extern Bool EnableCursor;
 
+/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
+ * CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
+ */
+extern Bool CursorVisible;
+
 extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
 extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
 extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 4d4a75e..d6f61c2 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -139,8 +139,7 @@ typedef struct _CursorScreen {
 #define Unwrap(as,s,elt,backup)	(((backup) = (s)->elt), (s)->elt = (as)->elt)
 
 /* The cursor doesn't show up until the first XDefineCursor() */
-static Bool CursorVisible = FALSE;
-
+Bool CursorVisible = FALSE;
 Bool EnableCursor = TRUE;
 
 static Bool
@@ -152,12 +151,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 
     Unwrap(cs, pScreen, DisplayCursor, backupProc);
 
-    /*
-     * Have to check ConnectionInfo to distinguish client requests from
-     * initial root window setup.  Not a great way to do it, I admit.
-     */
-    if (ConnectionInfo)
-        CursorVisible = EnableCursor;
+    CursorVisible = CursorVisible && EnableCursor;
 
     if (cs->pCursorHideCounts != NULL || !CursorVisible) {
         ret = (*pScreen->DisplayCursor) (pDev, pScreen, NullCursor);
commit b1c01839d8aec4266fd3731a04a23e34f182bf69
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Thu Dec 20 13:50:17 2012 +0100

    ephyr: Fix crash on 24bpp host framebuffer
    
    Use bytes_per_line and bits_per_pixel from the created XImage to fix
        https://bugzilla.redhat.com/show_bug.cgi?id=518960
    
    Signed-off-by: Daniel Martin <consume.noise at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit bd58ebe4cf3b0ce60f87fb26a3715f774dabd349)

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index e6520d0..c9672c0 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -237,13 +237,11 @@ ephyrMapFramebuffer(KdScreenInfo * screen)
     KdComputePointerMatrix(&m, ephyrRandr, screen->width, screen->height);
     KdSetPointerMatrix(&m);
 
-    priv->bytes_per_line =
-        ((screen->width * screen->fb.bitsPerPixel + 31) >> 5) << 2;
-
     buffer_height = ephyrBufferHeight(screen);
 
     priv->base =
-        hostx_screen_init(screen, screen->width, screen->height, buffer_height);
+        hostx_screen_init(screen, screen->width, screen->height, buffer_height,
+                          &priv->bytes_per_line, &screen->fb.bitsPerPixel);
 
     if ((scrpriv->randr & RR_Rotate_0) && !(scrpriv->randr & RR_Reflect_All)) {
         scrpriv->shadow = FALSE;
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 02729d6..dfbb989 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -617,7 +617,8 @@ hostx_set_cmap_entry(unsigned char idx,
  */
 void *
 hostx_screen_init(EphyrScreenInfo screen,
-                  int width, int height, int buffer_height)
+                  int width, int height, int buffer_height,
+                  int *bytes_per_line, int *bits_per_pixel)
 {
     int bitmap_pad;
     Bool shm_success = False;
@@ -694,6 +695,9 @@ hostx_screen_init(EphyrScreenInfo screen,
             malloc(host_screen->ximg->bytes_per_line * buffer_height);
     }
 
+    *bytes_per_line = host_screen->ximg->bytes_per_line;
+    *bits_per_pixel = host_screen->ximg->bits_per_pixel;
+
     XResizeWindow(HostX.dpy, host_screen->win, width, height);
 
     /* Ask the WM to keep our size static */
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index 31c4053..38b7b37 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -193,7 +193,8 @@ hostx_set_cmap_entry(unsigned char idx,
                      unsigned char r, unsigned char g, unsigned char b);
 
 void *hostx_screen_init(EphyrScreenInfo screen,
-                        int width, int height, int buffer_height);
+                        int width, int height, int buffer_height,
+                        int *bytes_per_line, int *bits_per_pixel);
 
 void
 
commit 4bd8e9ecc3dedb876b90b64fb8b140576d5a7b0b
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Mon Feb 11 14:31:56 2013 -0800

    xf86: use nt_list_for_each_entry_safe to walk InputHandlers in xf86Wakeup
    
    This is necessary when the input handler deletes itself from the
    list. Bug found by Maarten Lankhorst, this patch uses the list macros
    instead of open-coding the fix.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit da92690107d90061205340d4cdc98b73b59db9b2)

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 7e80fa9..b19553a 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -272,9 +272,9 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask)
     }
 
     if (err >= 0) {             /* we don't want the handlers called if select() */
-        IHPtr ih;               /* returned with an error condition, do we?      */
+        IHPtr ih, ih_tmp;       /* returned with an error condition, do we?      */
 
-        for (ih = InputHandlers; ih; ih = ih->next) {
+        nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) {
             if (ih->enabled && ih->fd >= 0 && ih->ihproc &&
                 (FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) {
                 ih->ihproc(ih->fd, ih->data);


More information about the xorg-commit mailing list