[PATCH v6 0/2] HID: multitouch: fix use-after-free of haptic data on delayed input release

From: Aldo Ariel Panzardo

Date: Fri Oct 16 2026 - 12:09:33 EST


v6 fixes issues found by Sashiko on v5.

Patch 1 is unchanged -- reorders try_module_get()/get_device() before
input_ff_create().

Patch 2 keeps the devm_add_action() design. Changes since v5:
- module_put moved to hid_haptic_destroy so the module stays loaded
until the FF subsystem is done with the callback; a second
__module_get covers hid_haptic_devm_release itself
- guard against double-init (return 0 when haptic->wq is set)
- NULL haptic->hdev and haptic->input_dev after put in devm_release
- restore dev->flush/event after input_ff_destroy on devm_add_action
failure

v5: https://lore.kernel.org/linux-input/20261016135516.2957381-1-qwe.aldo@xxxxxxxxx/
v4: https://lore.kernel.org/linux-input/20261009103333.2476105-1-qwe.aldo@xxxxxxxxx/
v1: https://lore.kernel.org/linux-input/20261009031207.3233206-1-qwe.aldo@xxxxxxxxx/

Aldo Ariel Panzardo (2):
HID: haptic: reorder try_module_get/get_device before input_ff_create
HID: multitouch: fix use-after-free of haptic data on delayed input
release

drivers/hid/hid-haptic.c | 93 ++++++++++++++++++++++++++++++++++------
1 file changed, 80 insertions(+), 13 deletions(-)

--
2.53.0