audk/MdeModulePkg/Bus/Usb/UsbBusDxe
Star Zeng acebdf14c9 MdeModulePkg UsbBusDxe: Fix wrong buffer length used to read hub desc
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=973

HUB descriptor has variable length.
But the code uses stack (HubDesc in UsbHubInit) with fixed length
sizeof(EFI_USB_HUB_DESCRIPTOR) to hold HUB descriptor data.
It uses hard code length value (32 that is greater than
sizeof(EFI_USB_HUB_DESCRIPTOR)) for SuperSpeed path, then there will
be stack overflow when IOMMU is enabled because the Unmap operation
will copy the data from device buffer to host buffer.
And it uses HubDesc->Length for none SuperSpeed path, then there will
be stack overflow when HubDesc->Length is greater than
sizeof(EFI_USB_HUB_DESCRIPTOR).

The patch updates the code to use a big enough buffer to hold the
descriptor data.
The definition EFI_USB_SUPER_SPEED_HUB_DESCRIPTOR is wrong (HubDelay
field should be UINT16 type) and no code is using it, the patch
removes it.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Bret Barkelew <bret.barkelew@microsoft.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
2018-06-27 12:38:47 +08:00
..
ComponentName.c
UsbBus.c MdeModulePkg/UsbBusDxe: Add UsbControlTransfer() error check 2017-11-20 14:43:28 -08:00
UsbBus.h
UsbBusDxe.inf
UsbBusDxe.uni
UsbBusDxeExtra.uni
UsbDesc.c MdeModulePkg/UsbBusDxe: Fixed USB descriptor length check 2016-06-29 10:37:22 +08:00
UsbDesc.h
UsbEnumer.c MdeModulePkg/UsbBusDxe: log warning message at DEBUG_WARN level 2017-09-11 22:38:59 +02:00
UsbEnumer.h
UsbHub.c MdeModulePkg UsbBusDxe: Fix wrong buffer length used to read hub desc 2018-06-27 12:38:47 +08:00
UsbHub.h MdeModulePkg UsbBusDxe: Fix wrong buffer length used to read hub desc 2018-06-27 12:38:47 +08:00
UsbUtility.c MdeModulePkg/UsbBus: Correct debug message 2017-06-02 12:59:28 +08:00
UsbUtility.h