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

USB: Fix SS endpoint companion descriptor parsing.

When there's a descriptor after the SuperSpeed endpoint companion
descriptor, the previous code would have skipped over twice the length it
was supposed to. This code fixes crashes seen with UASP devices (which
have a UASP descriptor after the SS endpoint companion descriptor).

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Sarah Sharp and committed by
Greg Kroah-Hartman
6682bb39 624defa1

+1 -1
+1 -1
drivers/usb/core/config.c
··· 105 105 ep->ss_ep_comp->extralen = i; 106 106 buffer += i; 107 107 size -= i; 108 - retval = buffer - buffer_start + i; 108 + retval = buffer - buffer_start; 109 109 if (num_skipped > 0) 110 110 dev_dbg(ddev, "skipped %d descriptor%s after %s\n", 111 111 num_skipped, plural(num_skipped),