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>
Wed, 17 May 2017 09:53:02 +0000 (11:53 +0200)
commit2c25a2c818023df64463aac3288a9f969491e507
treeddf956c04e2d94384f7a8ab9e676d05ce5052497
parentec963b412a54aac8e527708ecad06a6988a86fb4
USB: hub: fix SS hub-descriptor handling

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: stable <stable@vger.kernel.org> # 2.6.39
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