HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event
authorMa Ke <make_ruc2021@163.com>
Mon, 18 Sep 2023 02:40:59 +0000 (10:40 +0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 18 Sep 2023 15:13:01 +0000 (17:13 +0200)
commitffe3b7837a2bb421df84d0177481db9f52c93a71
treefb997d77650d9caab0b302004d92035024f26bbb
parent058574879853260a22bbec1f94221dfc5149d85c
HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event

There is a slab-out-of-bounds Write bug in hid-holtek-kbd driver.
The problem is the driver assumes the device must have an input
but some malicious devices violate this assumption.

Fix this by checking hid_device's input is non-empty before its usage.

Signed-off-by: Ma Ke <make_ruc2021@163.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-holtek-kbd.c