]> git.ipfire.org Git - thirdparty/kernel/stable.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>
Sat, 11 Mar 2023 15:26:33 +0000 (16:26 +0100)
commitdf0fad94ca3787727b9cdd76797aaacf46fe93ed
tree8c83d043126a7a615604fcd6670e6f02de3c2032
parente8b1d7525c3601d1bcc1b1211160d220fd45d8cd
HID: asus: use spinlock to safely schedule workers

commit 4ab3a086d10eeec1424f2e8a968827a6336203df 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: af22a610bc38 ("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