Commit f629b703 authored by Pietro Borrello's avatar Pietro Borrello Committed by sanglipeng
Browse files

HID: betop: check shape of output reports

stable inclusion
from stable-v5.10.166
commit 28fc6095da22dc88433d79578ae1c495ebe8ca43
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I87FRA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=28fc6095da22dc88433d79578ae1c495ebe8ca43



--------------------------------

[ Upstream commit 3782c0d6 ]

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: 52cd7785 ("HID: betop: add drivers/hid/hid-betopff.c")
Signed-off-by: default avatarPietro Borrello <borrello@diag.uniroma1.it>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 72e6b150
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment