Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

staging: gigaset: add endpoint-type sanity check

Add missing endpoint-type sanity checks to probe.

This specifically prevents a warning in USB core on URB submission when
fuzzing USB descriptors.

Signed-off-by: Johan Hovold <johan@kernel.org>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20191202085610.12719-4-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
ed9ed5a8 84f60ca7

+12
+12
drivers/staging/isdn/gigaset/usb-gigaset.c
··· 705 705 706 706 endpoint = &hostif->endpoint[0].desc; 707 707 708 + if (!usb_endpoint_is_bulk_out(endpoint)) { 709 + dev_err(&interface->dev, "missing bulk-out endpoint\n"); 710 + retval = -ENODEV; 711 + goto error; 712 + } 713 + 708 714 buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); 709 715 ucs->bulk_out_size = buffer_size; 710 716 ucs->bulk_out_epnum = usb_endpoint_num(endpoint); ··· 729 723 } 730 724 731 725 endpoint = &hostif->endpoint[1].desc; 726 + 727 + if (!usb_endpoint_is_int_in(endpoint)) { 728 + dev_err(&interface->dev, "missing int-in endpoint\n"); 729 + retval = -ENODEV; 730 + goto error; 731 + } 732 732 733 733 ucs->busy = 0; 734 734