]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
HID: wacom: Use ktime_t rather than int when dealing with timestamps
authorJason Gerecke <jason.gerecke@wacom.com>
Thu, 8 Jun 2023 21:38:28 +0000 (14:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:37:03 +0000 (08:37 +0200)
commit99036f1aed7e82773904f5d91a9897bb3e507fd9
tree52da7a03921069de4dcd2e9f17403a4a5e6389db
parent815c95d82b79bb32e9aa7c95c6ac7cb1c92612cd
HID: wacom: Use ktime_t rather than int when dealing with timestamps

commit 9a6c0e28e215535b2938c61ded54603b4e5814c5 upstream.

Code which interacts with timestamps needs to use the ktime_t type
returned by functions like ktime_get. The int type does not offer
enough space to store these values, and attempting to use it is a
recipe for problems. In this particular case, overflows would occur
when calculating/storing timestamps leading to incorrect values being
reported to userspace. In some cases these bad timestamps cause input
handling in userspace to appear hung.

Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/901
Fixes: 17d793f3ed53 ("HID: wacom: insert timestamp to packed Bluetooth (BT) events")
CC: stable@vger.kernel.org
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Link: https://lore.kernel.org/r/20230608213828.2108-1-jason.gerecke@wacom.com
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/wacom_wac.c
drivers/hid/wacom_wac.h