Fix crash when the Wacom Intuos Pro 3rd gen sends absolute wheel events

Resolves: RHEL-105483
This commit is contained in:
Peter Hutterer 2025-08-04 13:53:23 +10:00
parent 6e44c2d863
commit 2a5953d210
3 changed files with 152 additions and 9 deletions

View File

@ -1,4 +1,4 @@
From 431fe513644fc7b27043d6095549f70dc472c1c4 Mon Sep 17 00:00:00 2001
From f746dfd4d8e2c6c2dca522ca1269451612d5cef8 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 22 Jul 2025 14:22:34 +1000
Subject: [PATCH] RHEL: map dials to rings on the Intuos Pro 3rd Gen devices
@ -16,14 +16,14 @@ Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
meson.build | 1 +
quirks/30-vendor-wacom.quirks | 42 ++++++
src/evdev-tablet-pad.c | 135 ++++++++++++++++++
src/evdev-tablet-pad.c | 140 ++++++++++++++++++
src/evdev-tablet-pad.h | 13 ++
src/quirks.c | 1 +
src/quirks.h | 1 +
test/litest-device-wacom-intuos-pro-3rd-pad.c | 87 +++++++++++
test/litest.h | 1 +
test/test-tablet.c | 58 ++++++++
9 files changed, 339 insertions(+)
9 files changed, 344 insertions(+)
create mode 100644 test/litest-device-wacom-intuos-pro-3rd-pad.c
diff --git a/meson.build b/meson.build
@ -89,7 +89,7 @@ index 42748116ba5c..646f052be137 100644
+MatchProduct=0x03F5
+ModelWacomIntuosPro3rd=1
diff --git a/src/evdev-tablet-pad.c b/src/evdev-tablet-pad.c
index 4f4f7b57fc4b..70ad86d0077f 100644
index 4f4f7b57fc4b..4895e90ae188 100644
--- a/src/evdev-tablet-pad.c
+++ b/src/evdev-tablet-pad.c
@@ -96,6 +96,50 @@ pad_button_set_down(struct pad_dispatch *pad,
@ -272,13 +272,18 @@ index 4f4f7b57fc4b..70ad86d0077f 100644
int
evdev_device_tablet_pad_get_num_rings(struct evdev_device *device)
{
@@ -778,6 +909,10 @@ evdev_device_tablet_pad_get_num_rings(struct evdev_device *device)
@@ -778,6 +909,15 @@ evdev_device_tablet_pad_get_num_rings(struct evdev_device *device)
if (!(device->seat_caps & EVDEV_DEVICE_TABLET_PAD))
return -1;
+ /* RHEL dial-to-ring special */
+ if (evdev_device_has_model_quirk(device, QUIRK_MODEL_WACOM_INTUOS_PRO_3RD))
+ return count_dials(device->evdev);
+ /* RHEL dial-to-ring special. Depending on the kernel the device may
+ * not have REL_WHEEL and is still on ABS_WHEEL etc. So we only
+ * count the dials if they're nonzero, otherwise fall back to ring */
+ if (evdev_device_has_model_quirk(device, QUIRK_MODEL_WACOM_INTUOS_PRO_3RD)) {
+ nrings = count_dials(device->evdev);
+ if (nrings)
+ return nrings;
+ }
+
if (libevdev_has_event_code(device->evdev, EV_ABS, ABS_WHEEL)) {
nrings++;

View File

@ -0,0 +1,134 @@
From 35c2d7ebba6862be0531a588143522ebcd6170eb Mon Sep 17 00:00:00 2001
From: whot <whot@localhost.localdomain>
Date: Mon, 4 Aug 2025 13:43:54 +1000
Subject: [PATCH] pad: don't assert when unable to find the mode group, just
discard
Instead of a hard assert if we fail to find the mode group for the given
ring/dial/strip let's just log an error and discard the event.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
src/evdev-tablet-pad.c | 58 +++++++++++++++++++++++-------------------
src/evdev-tablet-pad.h | 1 +
2 files changed, 33 insertions(+), 26 deletions(-)
diff --git a/src/evdev-tablet-pad.c b/src/evdev-tablet-pad.c
index 4895e90ae188..782b04be00cd 100644
--- a/src/evdev-tablet-pad.c
+++ b/src/evdev-tablet-pad.c
@@ -270,8 +270,9 @@ pad_ring_get_mode_group(struct pad_dispatch *pad,
return group;
}
- assert(!"Unable to find ring mode group");
-
+ evdev_log_bug_libinput_ratelimit(pad->device,
+ &pad->modes.group_not_found,
+ "Unable to find mode group for ring %d\n", ring);
return NULL;
}
@@ -337,12 +338,13 @@ pad_check_notify_axes(struct pad_dispatch *pad,
degrees = fmod(degrees + 180, 360);
group = pad_ring_get_mode_group(pad, 0);
- tablet_pad_notify_ring(base,
- time,
- 0,
- degrees,
- LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN,
- group);
+ if (group)
+ tablet_pad_notify_ring(base,
+ time,
+ 0,
+ degrees,
+ LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN,
+ group);
}
if (pad->changed_axes & PAD_AXIS_DIAL2 && pad->dials.map_to_ring) {
@@ -351,12 +353,13 @@ pad_check_notify_axes(struct pad_dispatch *pad,
degrees = fmod(degrees + 180, 360);
group = pad_ring_get_mode_group(pad, 1);
- tablet_pad_notify_ring(base,
- time,
- 1,
- degrees,
- LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN,
- group);
+ if (group)
+ tablet_pad_notify_ring(base,
+ time,
+ 1,
+ degrees,
+ LIBINPUT_TABLET_PAD_RING_SOURCE_UNKNOWN,
+ group);
}
if (pad->changed_axes & PAD_AXIS_RING1) {
@@ -365,12 +368,13 @@ pad_check_notify_axes(struct pad_dispatch *pad,
value = -1.0;
group = pad_ring_get_mode_group(pad, 0);
- tablet_pad_notify_ring(base,
- time,
- 0,
- value,
- LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER,
- group);
+ if (group)
+ tablet_pad_notify_ring(base,
+ time,
+ 0,
+ value,
+ LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER,
+ group);
}
if (pad->changed_axes & PAD_AXIS_RING2) {
@@ -379,12 +383,13 @@ pad_check_notify_axes(struct pad_dispatch *pad,
value = -1.0;
group = pad_ring_get_mode_group(pad, 1);
- tablet_pad_notify_ring(base,
- time,
- 1,
- value,
- LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER,
- group);
+ if (group)
+ tablet_pad_notify_ring(base,
+ time,
+ 1,
+ value,
+ LIBINPUT_TABLET_PAD_RING_SOURCE_FINGER,
+ group);
}
if (pad->changed_axes & PAD_AXIS_STRIP1) {
@@ -774,6 +779,7 @@ pad_init(struct pad_dispatch *pad, struct evdev_device *device)
pad->device = device;
pad->status = PAD_NONE;
pad->changed_axes = PAD_AXIS_NONE;
+ ratelimit_init(&pad->modes.group_not_found, s2us(60 * 60), 2);
/* RHEL dial-to-ring special */
pad->dials.map_to_ring = evdev_device_has_model_quirk(device, QUIRK_MODEL_WACOM_INTUOS_PRO_3RD);
diff --git a/src/evdev-tablet-pad.h b/src/evdev-tablet-pad.h
index c9c23583c714..c5aab243aab8 100644
--- a/src/evdev-tablet-pad.h
+++ b/src/evdev-tablet-pad.h
@@ -93,6 +93,7 @@ struct pad_dispatch {
struct {
struct list mode_group_list;
+ struct ratelimit group_not_found;
} modes;
};
--
2.50.1

View File

@ -5,7 +5,7 @@
Name: libinput
Version: 1.19.3
Release: 6%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Release: 7%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Summary: Input device library
License: MIT
@ -24,6 +24,7 @@ Patch0003: 0003-quirks-Dell-Mayabay-Pressure-Pad.patch
Patch0004: 0004-quirks-add-quirk-for-Dell-Haptics-Touchpad.patch
Patch0005: 0005-quirks-add-quirks-for-Dell-laptop-with-Goodix-Touchp.patch
Patch0006: 0006-RHEL-map-dials-to-rings-on-the-Intuos-Pro-3rd-Gen-de.patch
Patch0007: 0007-pad-don-t-assert-when-unable-to-find-the-mode-group-.patch
BuildRequires: git-core
BuildRequires: gcc
@ -153,6 +154,9 @@ pathfix.py -i %{__python3} -p -n $(git grep -l '#!/usr/bin/.*python3')
%{_mandir}/man1/libinput-test-suite.1*
%changelog
* Mon Aug 04 2025 Peter Hutterer <peter.hutterer@redhat.com> - 1.19.3-7
- Fix crash when the Wacom Intuos Pro 3rd gen sends absolute wheel events
* Fri Jul 25 2025 Peter Hutterer <peter.hutterer@redhat.com> - 1.19.3-6
- Add support for the Wacom Intuos Pro (RHEL-105483)
- Rename existing patches for better order clarity