[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'ubuntu'



 debian/changelog                                |    9 +++++
 debian/patches/221_fix_SendEvent_flag_mask.diff |   42 ++++++++++++++++++++++++
 debian/patches/series                           |    1 
 3 files changed, 52 insertions(+)

New commits:
commit d9f8c8f35018310e07629d36217e778c63483c4f
Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Date:   Tue Sep 13 17:08:14 2011 -0500

    Add patch from Sam to fix SendEvent with ShapeNotify

diff --git a/debian/changelog b/debian/changelog
index 3f4b4c9..38c33e1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+xorg-server (2:1.10.4-1ubuntu2) UNRELEASED; urgency=low
+
+  * debian/patches/221_fix_SendEvent_flag_mask.diff:
+    - Add patch from Sam Spilsbury to fix the event mask handling which would
+      generate an incorrect BadValue error when a client tries to use SendEvent
+      with ShapeNotify.
+
+ -- Christopher James Halse Rogers <raof@ubuntu.com>  Tue, 13 Sep 2011 17:05:48 -0500
+
 xorg-server (2:1.10.4-1ubuntu1) oneiric; urgency=low
 
   [ Christopher James Halse Rogers ]
diff --git a/debian/patches/221_fix_SendEvent_flag_mask.diff b/debian/patches/221_fix_SendEvent_flag_mask.diff
new file mode 100644
index 0000000..8bbbf36
--- /dev/null
+++ b/debian/patches/221_fix_SendEvent_flag_mask.diff
@@ -0,0 +1,42 @@
+From 4ce5d1cab01b911ab9672dbd1e773faace62e243 Mon Sep 17 00:00:00 2001
+From: Sam Spilsbury <sam.spilsbury@canonical.com>
+Date: Tue, 13 Sep 2011 19:17:56 +0800
+Subject: [PATCH] Fix SendEvent requests coming from extensions which set 0x80
+ being invalid.
+
+Some (broken?) extension libraries set the SendEvent "magic" bit in the
+event->type field before sending the request down the wire, so when we
+did a range check on event->type it is possible that it could have been
+invalid (this is at least the case for XShape). As such, we should remove 0x80
+from the bitfield before doing a range check on the event. This is safe
+since we will re-set 0x80 on the bitfield after checking the event
+before writing it to the client.
+---
+ dix/events.c |   11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/dix/events.c b/dix/events.c
+index 8a4c6b9..cf24869 100644
+--- a/dix/events.c
++++ b/dix/events.c
+@@ -5241,6 +5241,17 @@ ProcSendEvent(ClientPtr client)
+ 
+     REQUEST_SIZE_MATCH(xSendEventReq);
+ 
++    /* libXext and other extension libraries may set the bit indicating
++     * that this event came from a SendEvent request so remove it
++     * since otherwise the event type may fail the range checks
++     * and cause an invalid BadValue error to be returned.
++     *
++     * This is safe to do since we later add the SendEvent bit (0x80)
++     * back in once we send the event to the client */
++
++    if (stuff->event.u.u.type & 0x80)
++	stuff->event.u.u.type &= ~(0x80);
++
+     /* The client's event type must be a core event type or one defined by an
+ 	extension. */
+ 
+-- 
+1.7.5.4
+
diff --git a/debian/patches/series b/debian/patches/series
index cd52d60..9c2d775 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -31,6 +31,7 @@
 217_revert_bgnonevisitwindow.patch
 219_fedora-pointer-barriers.diff
 220_xi21_always_deliver_raw_events.diff
+221_fix_SendEvent_flag_mask.diff
 500_xi2.1.patch
 501_xf86CoordinatesToWindow.patch
 502_gestures-extension.patch


Reply to: