]> git.baikalelectronics.ru Git - kernel.git/commit
HID: betop: fix slab-out-of-bounds Write in betop_probe
authorF.A.Sulaiman <asha.16@itfac.mrt.ac.lk>
Tue, 24 Aug 2021 15:07:30 +0000 (20:37 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 13:42:39 +0000 (15:42 +0200)
commitb612ce8524b3a181e81703b4c757bf915aa3c88c
tree2aac4500a1ea339cf6e594c27e27dc3b48a1f6ec
parentc76a65f19950d94a60bb890911e3dbdf3143908f
HID: betop: fix slab-out-of-bounds Write in betop_probe

commit 1e4ce418b1cb1a810256b5fb3fd33d22d1325993 upstream.

Syzbot reported slab-out-of-bounds Write bug in hid-betopff driver.
The problem is the driver assumes the device must have an input report but
some malicious devices violate this assumption.

So this patch checks hid_device's input is non empty before it's been used.

Reported-by: syzbot+07efed3bc5a1407bd742@syzkaller.appspotmail.com
Signed-off-by: F.A. SULAIMAN <asha.16@itfac.mrt.ac.lk>
Reviewed-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hid/hid-betopff.c