linux/drivers/input
Pavel Skripkin 5600f69866 Input: aiptek - properly check endpoint type
Syzbot reported warning in usb_submit_urb() which is caused by wrong
endpoint type. There was a check for the number of endpoints, but not
for the type of endpoint.

Fix it by replacing old desc.bNumEndpoints check with
usb_find_common_endpoints() helper for finding endpoints

Fail log:

usb 5-1: BOGUS urb xfer, pipe 1 != type 3
WARNING: CPU: 2 PID: 48 at drivers/usb/core/urb.c:502 usb_submit_urb+0xed2/0x18a0 drivers/usb/core/urb.c:502
Modules linked in:
CPU: 2 PID: 48 Comm: kworker/2:2 Not tainted 5.17.0-rc6-syzkaller-00226-g07ebd38a0da2 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014
Workqueue: usb_hub_wq hub_event
...
Call Trace:
 <TASK>
 aiptek_open+0xd5/0x130 drivers/input/tablet/aiptek.c:830
 input_open_device+0x1bb/0x320 drivers/input/input.c:629
 kbd_connect+0xfe/0x160 drivers/tty/vt/keyboard.c:1593

Fixes: 8e20cf2bce ("Input: aiptek - fix crash on detecting device without endpoints")
Reported-and-tested-by: syzbot+75cccf2b7da87fb6f84b@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20220308194328.26220-1-paskripkin@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2022-03-14 18:15:11 -07:00
..
gameport bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
joystick Merge branch 'next' into for-linus 2022-01-15 12:09:44 -08:00
keyboard Input: samsung-keypad - properly state IOMEM dependency 2022-02-27 21:03:55 -08:00
misc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2022-01-17 08:27:55 +02:00
mouse Input: elan_i2c - fix regulator enable count imbalance after suspend/resume 2022-03-01 20:41:22 -08:00
rmi4 Input: synaptics-rmi4 - Fix device hierarchy 2021-11-05 19:46:21 -07:00
serio Merge branch 'next' into for-linus 2022-01-15 12:09:44 -08:00
tablet Input: aiptek - properly check endpoint type 2022-03-14 18:15:11 -07:00
touchscreen Input: zinitix - do not report shadow fingers 2022-03-07 14:23:35 -08:00
apm-power.c
evbug.c Input: evbug - remove an empty comment block 2021-05-24 21:06:39 -07:00
evdev.c Input: evdev - per-client waitgroups 2020-10-06 18:34:15 -07:00
ff-core.c Input: ff-core - correct magnitude setting for rumble compatibility 2021-12-06 23:24:03 -08:00
ff-memless.c
input-compat.c
input-compat.h
input-leds.c
input-mt.c
input-poller.c Input: use input_device_enabled() 2020-12-02 22:10:33 -08:00
input-poller.h
input.c Input: clear BTN_RIGHT/MIDDLE on buttonpads 2022-02-08 12:57:22 -08:00
joydev.c HID: nintendo: add IMU support 2021-10-27 10:05:52 +02:00
Kconfig um: allow disabling NO_IOMEM 2021-06-17 21:44:50 +02:00
Makefile Input: touchscreen - move helper functions to core 2021-03-25 11:14:09 -07:00
matrix-keymap.c
mousedev.c
sparse-keymap.c
touchscreen.c Input: touchscreen - avoid bitwise vs logical OR warning 2021-10-15 22:22:54 -07:00