linux/tools/testing/selftests/hid/tests
Trung Nguyen b6eb022890 selftests/hid: multitouch: test a large ContactCountMaximum
Add a regression test for the out-of-bounds bit operations on
struct mt_device.mt_io_flags.

A HID multitouch device can advertise a ContactCountMaximum far larger
than the number of contacts a single report describes, up to 255. The
driver used to keep the per-slot active state in the bits of a single
unsigned long and index set_bit()/clear_bit() by the slot number, so such
a device drove those operations out of bounds. The sticky-fingers release
timer made it fatal: mt_release_contacts() cleared one bit per slot and
overwrote the adjacent members of struct mt_device.

The new device advertises a ContactCountMaximum of 250 while exposing only
a few finger collections (a large contact count cannot be expressed with
one finger collection per contact within the HID descriptor size limit).
The test sends a single contact and lets the 100ms sticky-fingers timer
release it. A kernel without the fix panics in mt_release_contacts(); a
fixed kernel reports the release cleanly.

Signed-off-by: Trung Nguyen <trungnh@cystack.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
2026-07-01 20:36:12 +02:00
..
__init__.py
base_device.py selftests/hid: sync python tests to hid-tools 0.10 2025-07-10 16:20:27 +02:00
base_gamepad.py selftests/hid: import base_gamepad.py from hid-tools 2024-05-07 15:39:47 +02:00
base.py selftests/hid: sync the python tests to hid-tools 0.8 2025-07-10 16:20:27 +02:00
conftest.py selftests/hid: require hidtools 0.12 2026-01-07 15:28:09 +01:00
descriptors_wacom.py selftests: hid: import hid-tools wacom tests 2023-04-12 17:13:38 +02:00
test_apple_keyboard.py selftests/hid: sync the python tests to hid-tools 0.8 2025-07-10 16:20:27 +02:00
test_gamepad.py selftests/hid: sync the python tests to hid-tools 0.8 2025-07-10 16:20:27 +02:00
test_hid_core.py
test_ite_keyboard.py selftests/hid: sync the python tests to hid-tools 0.8 2025-07-10 16:20:27 +02:00
test_keyboard.py selftests: hid: import hid-tools hid-keyboards tests 2023-04-12 17:13:37 +02:00
test_mouse.py selftests/hid: add a test case for the recent syzbot underflow 2025-07-13 09:53:28 +02:00
test_multitouch.py selftests/hid: multitouch: test a large ContactCountMaximum 2026-07-01 20:36:12 +02:00
test_sony.py selftests/hid: sync the python tests to hid-tools 0.8 2025-07-10 16:20:27 +02:00
test_tablet.py selftests/hid-tablet: add ABS_DISTANCE test for stylus/pen 2025-11-20 22:47:14 +01:00
test_usb_crash.py selftests: hid: import hid-tools usb-crash tests 2023-04-12 17:13:38 +02:00
test_wacom_generic.py selftests: hid: tests: test_wacom_generic: add tests for display devices and opaque devices 2026-02-24 09:41:21 +01:00