mirror-linux/drivers/hid/usbhid
Tomasz Pakuła 48d1677779 HID: pidff: Fix integer overflow in pidff_rescale
Rescaling values close to the max (U16_MAX) temporarily creates values
that exceed the s32 range. This caused value overflow in case when, for
example, a periodic effect phase was higer than 180 degrees. In turn,
rescale function could return values outised of the logical range of the
HID field.

Fix by using 64 bit signed integer to store the value during calculation
but still return only 32 bit integer.

Closes: https://github.com/JacKeTUs/universal-pidff/issues/116
Fixes: 224ee88fe3 ("Input: add force feedback driver for PID devices")
Cc: stable@vger.kernel.org
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
2026-05-12 18:13:40 +02:00
..
Kconfig HID: intel-thc: fix CONFIG_HID dependency 2025-02-03 10:56:43 +01:00
Makefile HID: core: move the dynamic quirks handling in core 2017-11-21 11:14:48 +01:00
hid-core.c HID: core: introduce hid_safe_input_report() 2026-05-12 18:03:58 +02:00
hid-pidff.c HID: pidff: Fix integer overflow in pidff_rescale 2026-05-12 18:13:40 +02:00
hid-pidff.h HID: pidff: Add MISSING_DEADBAND quirk 2026-02-26 15:46:00 +01:00
hiddev.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
usbhid.h Revert "HID: usbhid: do not sleep when opening device" 2020-08-18 19:54:04 +02:00
usbkbd.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
usbmouse.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00