Input: xpad - validate USB endpoint count during probe
Subsystems (2)
PATCH 1/1 Input: xpad - validate USB endpoint count during probe
This prevents a malicious USB device from causing an oops.
Signed-off-by Cameron Gutman <[email protected]>
--- drivers/input/joystick/xpad.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/input/joystick/xpad.c +3 -0
@@ -1431,6 +1431,9 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *idint 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))
Signature · 1 line
2.7.4
Quoted 5 lines · Cameron Gutman
This prevents a malicious USB device from causing an oops.
Signed-off-by Cameron Gutman <[email protected]>---
Applied, thank you.
Quoted 19 lines
drivers/input/joystick/xpad.c | 3 +++ 1 file changed, 3 insertions(+)drivers/input/joystick/xpad.c +3
-0@@ -1431,6 +1431,9 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *idint 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))Signature · 1 line
2.7.4
Signature · 1 line
Dmitry