Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c47eb06 authored by Maulik Mankad's avatar Maulik Mankad Committed by Greg Kroah-Hartman
Browse files

usb: gadget: composite: avoid access beyond array max length



One of the USB CV MSC tests issues Get Max LUN request with
invalid wIndex (wIndex = 65535) parameter.

Add proper handling to prevent array index out of bounds issue.

Signed-off-by: default avatarMaulik Mankad <maulik@ti.com>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d14fc1a7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -928,7 +928,8 @@ unknown:
		 */
		switch (ctrl->bRequestType & USB_RECIP_MASK) {
		case USB_RECIP_INTERFACE:
			if (cdev->config)
			if (!cdev->config || w_index >= MAX_CONFIG_INTERFACES)
				break;
			f = cdev->config->interface[intf];
			break;