xserver: Branch 'server-1.20-branch' - 2 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 9 07:13:34 UTC 2021
dix/devices.c | 3 +++
hw/xwayland/xwayland-input.c | 4 ++++
2 files changed, 7 insertions(+)
New commits:
commit 6272529339f975777f22bb0e6162ac43480ae257
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
(cherry picked from commit dee2bb033e78e2f4aae7f5708c3d4fc74a9957de)
diff --git a/dix/devices.c b/dix/devices.c
index 00c453980..e7c74d7b7 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2261,6 +2261,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 d41b43345cde2330648ad1890fb95bdbd5362f7f
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
(cherry picked from commit ab76272a7d2bff997985893c89147412a7360310)
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index a05d178ff..6647914f2 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -279,6 +279,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