HID: bigben: fix slab-out-of-bounds Write in bigben_probe
authorDongliang Mu <mudongliangabcd@gmail.com>
Fri, 6 May 2022 07:24:25 +0000 (15:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:36 +0000 (10:22 +0200)
commit22e0b0b84c538b60bdf8eeceee7ab3cebf4a1a09
treedef390bb6779534a7e5c7260c7ad231d1164dd96
parent4262a0e46b08b274511ed7133363c8d8ad189082
HID: bigben: fix slab-out-of-bounds Write in bigben_probe

[ Upstream commit fc4ef9d5724973193bfa5ebed181dba6de3a56db ]

There is a slab-out-of-bounds Write bug in hid-bigbenff 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.

Reported-by: syzkaller <syzkaller@googlegroups.com>
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-bigbenff.c