xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 16 08:42:23 UTC 2021


 dix/devices.c                |    3 +++
 hw/xwayland/xwayland-input.c |    4 ++++
 2 files changed, 7 insertions(+)

New commits:
commit dee2bb033e78e2f4aae7f5708c3d4fc74a9957de
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Feb 15 11:33:56 2021 +0100

    dix: Guard against non-existing PtrFeedbackPtr
    
    Trying to change the pointer control settings on a device without
    PtrFeedbackPtr would be a bug and a crash in the Xserver.
    
    Guard against that case by returning early with a BadImplementation
    error, that might kill the X11 client but the Xserver would survive.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1137

diff --git a/dix/devices.c b/dix/devices.c
index 0ab9f37c2..85d899c20 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2257,6 +2257,9 @@ ProcChangePointerControl(ClientPtr client)
     REQUEST(xChangePointerControlReq);
     REQUEST_SIZE_MATCH(xChangePointerControlReq);
 
+    /* If the device has no PtrFeedbackPtr, the xserver has a bug */
+    BUG_RETURN_VAL (!mouse->ptrfeed, BadImplementation);
+
     ctrl = mouse->ptrfeed->ctrl;
     if ((stuff->doAccel != xTrue) && (stuff->doAccel != xFalse)) {
         client->errorValue = stuff->doAccel;
commit ab76272a7d2bff997985893c89147412a7360310
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Feb 15 11:23:59 2021 +0100

    xwayland: Add PtrFeedback to the touch device
    
    Trying to change the acceleration/threshold on Xwayland cannot work, and
    the corresponding handler xwl_pointer_control() is a no-op.
    
    Yet, an X11 client trying to change those on the touch device may
    possibly cause a crash because the touch device in Xwayland doesn't set
    that.
    
    Initialize the touch device's PtrFeedback to make sure that just cannot
    happen.
    
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1137

diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index c69636d7d..9529720a6 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -303,6 +303,10 @@ xwl_touch_proc(DeviceIntPtr device, int what)
                                0, 0xFFFF, 10000, 0, 10000, Absolute);
         InitValuatorAxisStruct(device, 1, axes_labels[1],
                                0, 0xFFFF, 10000, 0, 10000, Absolute);
+
+        if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control))
+            return BadValue;
+
         return Success;
 
     case DEVICE_ON:


More information about the xorg-commit mailing list