“f159f4ed55bb0fa5470800641e03a13a7e0eae6e”上不存在“arch/arm/include/uapi/asm/hwcap.h”
提交 d495c1ba 编写于 作者: H Hans de Goede 提交者: Sarah Sharp

uas: Fix bounds check in uas_find_endpoints

The loop uses up to 3 bytes of the endpoint extra data.
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
上级 34f11e59
...@@ -907,7 +907,7 @@ static int uas_find_endpoints(struct usb_host_interface *alt, ...@@ -907,7 +907,7 @@ static int uas_find_endpoints(struct usb_host_interface *alt,
for (i = 0; i < n_endpoints; i++) { for (i = 0; i < n_endpoints; i++) {
unsigned char *extra = endpoint[i].extra; unsigned char *extra = endpoint[i].extra;
int len = endpoint[i].extralen; int len = endpoint[i].extralen;
while (len > 1) { while (len >= 3) {
if (extra[1] == USB_DT_PIPE_USAGE) { if (extra[1] == USB_DT_PIPE_USAGE) {
unsigned pipe_id = extra[2]; unsigned pipe_id = extra[2];
if (pipe_id > 0 && pipe_id < 5) if (pipe_id > 0 && pipe_id < 5)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册