USB: hub: fix SS hub-descriptor handling
authorJohan Hovold <johan@kernel.org>
Wed, 10 May 2017 16:18:27 +0000 (18:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 13:44:41 +0000 (15:44 +0200)
commit3e4a4e68df087008be9686a9d5cefd90d5341587
tree136fd068546026e4878527cc17261a8d0ebc43ea
parentf9cd79e0ad1fa620ff34715d24ae1b671c97bc91
USB: hub: fix SS hub-descriptor handling

commit 2c25a2c818023df64463aac3288a9f969491e507 upstream.

A SuperSpeed hub descriptor does not have any variable-length fields so
bail out when reading a short descriptor.

This avoids parsing and leaking two bytes of uninitialised slab data
through sysfs removable-attributes.

Fixes: dbe79bbe9dcb ("USB 3.0 Hub Changes")
Cc: John Youn <John.Youn@synopsys.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c