projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a9b6aa
)
Input: xpad - validate USB endpoint count during probe
author
Cameron Gutman
<
[email protected]
>
Wed, 29 Jun 2016 16:51:35 +0000
(09:51 -0700)
committer
Dmitry Torokhov
<
[email protected]
>
Wed, 29 Jun 2016 17:07:47 +0000
(10:07 -0700)
This prevents a malicious USB device from causing an oops.
Signed-off-by: Cameron Gutman <
[email protected]
>
Cc:
[email protected]
Signed-off-by: Dmitry Torokhov <
[email protected]
>
drivers/input/joystick/xpad.c
patch
|
blob
|
history
diff --git
a/drivers/input/joystick/xpad.c
b/drivers/input/joystick/xpad.c
index 3438e98c145a9530058408c98524f75e543f658a..a529a4535457217e761fd1e8f8b0748cb48a5498 100644
(file)
--- a/
drivers/input/joystick/xpad.c
+++ b/
drivers/input/joystick/xpad.c
@@
-1431,6
+1431,9
@@
static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
int ep_irq_in_idx;
int i, error;
+ if (intf->cur_altsetting->desc.bNumEndpoints != 2)
+ return -ENODEV;
+
for (i = 0; xpad_device[i].idVendor; i++) {
if ((le16_to_cpu(udev->descriptor.idVendor) == xpad_device[i].idVendor) &&
(le16_to_cpu(udev->descriptor.idProduct) == xpad_device[i].idProduct))