mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 21:03:32 +00:00
HID: bigben: fix slab-out-of-bounds Write in bigben_probe
[ Upstream commit fc4ef9d572
]
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>
This commit is contained in:
parent
e7be387758
commit
50db547e5f
1 changed files with 6 additions and 0 deletions
|
@ -347,6 +347,12 @@ static int bigben_probe(struct hid_device *hid,
|
|||
bigben->report = list_entry(report_list->next,
|
||||
struct hid_report, list);
|
||||
|
||||
if (list_empty(&hid->inputs)) {
|
||||
hid_err(hid, "no inputs found\n");
|
||||
error = -ENODEV;
|
||||
goto error_hw_stop;
|
||||
}
|
||||
|
||||
hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
|
||||
set_bit(FF_RUMBLE, hidinput->input->ffbit);
|
||||
|
||||
|
|
Loading…
Reference in a new issue