mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-16 07:35:14 +00:00
Input: iforce - add sanity checks
commit 849f5ae3a5
upstream.
The endpoint type should also be checked before a device
is accepted.
Reported-by: syzbot+5efc10c005014d061a74@syzkaller.appspotmail.com
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
08b3af00a1
commit
f13de3d677
1 changed files with 5 additions and 0 deletions
|
@ -141,7 +141,12 @@ static int iforce_usb_probe(struct usb_interface *intf,
|
|||
return -ENODEV;
|
||||
|
||||
epirq = &interface->endpoint[0].desc;
|
||||
if (!usb_endpoint_is_int_in(epirq))
|
||||
return -ENODEV;
|
||||
|
||||
epout = &interface->endpoint[1].desc;
|
||||
if (!usb_endpoint_is_int_out(epout))
|
||||
return -ENODEV;
|
||||
|
||||
if (!(iforce = kzalloc(sizeof(struct iforce) + 32, GFP_KERNEL)))
|
||||
goto fail;
|
||||
|
|
Loading…
Reference in a new issue