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

Bug 973 just mentions UsbBusDxe, but UsbBusPei has similar issue.

HUB descriptor has variable length.
But the code uses stack (HubDescriptor in PeiDoHubConfig) with fixed
length sizeof(EFI_USB_HUB_DESCRIPTOR) to hold HUB descriptor data.
It uses hard code length value (12) for SuperSpeed path.
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.

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:52 +08:00
..
UsbBotPei MdeModulePkg/UsbBotPei: Fix undefined behavior in signed left shift 2017-04-13 08:59:07 +08:00
UsbBusDxe MdeModulePkg UsbBusDxe: Fix wrong buffer length used to read hub desc 2018-06-27 12:38:47 +08:00
UsbBusPei MdeModulePkg UsbBusPei: Fix wrong buffer length used to read hub desc 2018-06-27 12:38:52 +08:00
UsbKbDxe MdeModulePkg/UsbKb: fix shell edit cannot read '!@#$%^&*' characters 2018-03-26 09:28:58 +08:00
UsbMassStorageDxe MdeModulePkg/Usb: Replace macro USB_BOOT_IO_BLOCKS 2018-03-26 11:02:43 +08:00
UsbMouseAbsolutePointerDxe MdeModulePkg/UsbMouseAbsolutePointerDxe: fix VS2015 NOOPT build error 2016-05-12 10:01:22 +08:00
UsbMouseDxe MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00