]> git.baikalelectronics.ru Git - kernel.git/commit
HID: betop: check shape of output reports
authorPietro Borrello <borrello@diag.uniroma1.it>
Wed, 11 Jan 2023 18:12:16 +0000 (18:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 06:52:39 +0000 (07:52 +0100)
commitef832b0bb8f015a06495770c90689f53053fe1c1
treefba2a472de470a5db507986fa13d4db25c0a02f4
parent44f11370a871ec6d61ba8d10120b2d7e45a09dd8
HID: betop: check shape of output reports

[ Upstream commit 3782c0d6edf658b71354a64d60aa7a296188fc90 ]

betopff_init() only checks the total sum of the report counts for each
report field to be at least 4, but hid_betopff_play() expects 4 report
fields.
A device advertising an output report with one field and 4 report counts
would pass the check but crash the kernel with a NULL pointer dereference
in hid_betopff_play().

Fixes: ec3b5e6568dc ("HID: betop: add drivers/hid/hid-betopff.c")
Signed-off-by: Pietro Borrello <borrello@diag.uniroma1.it>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hid/hid-betopff.c