]> 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)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:08:02 +0000 (10:08 +0200)
commit36b68b271e6fb89d80006ed5f29a9ce29da89ab0
tree608735fa78ef32d6c994fd8e6728188938eb400f
parent356c77bc1a247cdf7d24733311d96ca9fe466b61
HID: betop: fix slab-out-of-bounds Write in betop_probe

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>
drivers/hid/hid-betopff.c