]> git.baikalelectronics.ru Git - kernel.git/commit
HID: asus: use spinlock to safely schedule workers
authorPietro Borrello <borrello@diag.uniroma1.it>
Sun, 12 Feb 2023 19:00:03 +0000 (19:00 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:32:32 +0000 (09:32 +0100)
commit59ac3f785036b528d8f72f532a415f76dad2ba02
tree85dca9c52189398ee19df305fe41a46d2521a68a
parent7b90a8b0ff370c09fc01a8edeb616f896ce42bc4
HID: asus: use spinlock to safely schedule workers

commit ad17201cd262ad691468ff3d636618e554214bfb upstream.

Use spinlocks to deal with workers introducing a wrapper
asus_schedule_work(), and several spinlock checks.
Otherwise, asus_kbd_backlight_set() may schedule led->work after the
structure has been freed, causing a use-after-free.

Fixes: dd7622c7552f ("HID: asus: support backlight on USB keyboards")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Link: https://lore.kernel.org/r/20230125-hid-unregister-leds-v4-5-7860c5763c38@diag.uniroma1.it
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-asus.c