فهرست منبع

uas: Fix bounds check in uas_find_endpoints

The loop uses up to 3 bytes of the endpoint extra data.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Hans de Goede 11 سال پیش
والد
کامیت
d495c1baa1
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      drivers/usb/storage/uas.c

+ 1 - 1
drivers/usb/storage/uas.c

@@ -907,7 +907,7 @@ static int uas_find_endpoints(struct usb_host_interface *alt,
 	for (i = 0; i < n_endpoints; i++) {
 		unsigned char *extra = endpoint[i].extra;
 		int len = endpoint[i].extralen;
-		while (len > 1) {
+		while (len >= 3) {
 			if (extra[1] == USB_DT_PIPE_USAGE) {
 				unsigned pipe_id = extra[2];
 				if (pipe_id > 0 && pipe_id < 5)