summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTrung Nguyen <trungnh@cystack.net>2026-07-02 00:13:20 +0700
committerBenjamin Tissoires <bentiss@kernel.org>2026-07-01 20:36:12 +0200
commitb6eb022890c78285f55381589c1536bd66b8eaeb (patch)
treee86c86cb60eb3eb40ea3f0811378511297fc6b05 /include
parent8813b0612275cc61fe9e6603d0ee019247ade6be (diff)
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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions