]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 09:13:32 +0000 (11:13 +0200)
commit010d49c773ba80bbe3600b98d7a3350201fd6913
treebdd46363663f8c3c8efc2c7a6b3411f082b97c11
parent5a4b644a565920de20d44cdb14407f957fccbd70
HID: holtek: fix slab-out-of-bounds Write in holtek_kbd_input_event

[ Upstream commit ffe3b7837a2bb421df84d0177481db9f52c93a71 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-holtek-kbd.c