]> git.baikalelectronics.ru Git - kernel.git/commit
hid: bigben_probe(): validate report count
authorPietro Borrello <borrello@diag.uniroma1.it>
Sun, 12 Feb 2023 00:01:44 +0000 (00:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:49 +0000 (16:43 +0100)
commit7fba3427c7349cbf7dae9ed48c8450ac44c05b79
treef322df9ccfc67632c428b5904aa2bd641cfaf4f6
parent708ce89539086a2774cd83b30983dd8ee16221e4
hid: bigben_probe(): validate report count

[ Upstream commit b94335f899542a0da5fafc38af8edcaf90195843 ]

bigben_probe() does not validate that the output report has the
needed report values in the first field.
A malicious device registering a report with one field and a single
value causes an head OOB write in bigben_worker() when
accessing report_field->value[1] to report_field->value[7].
Use hid_validate_values() which takes care of all the needed checks.

Fixes: 39389480d39b ("HID: hid-bigbenff: driver for BigBen Interactive PS3OFMINIPAD gamepad")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Link: https://lore.kernel.org/r/20230211-bigben-oob-v1-1-d2849688594c@diag.uniroma1.it
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-bigbenff.c