audk/MdeModulePkg/Bus/Usb/UsbBusPei
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
..
HubPeim.c MdeModulePkg UsbBusPei: Fix wrong buffer length used to read hub desc 2018-06-27 12:38:52 +08:00
HubPeim.h MdeModulePkg UsbBusPei: Fix wrong buffer length used to read hub desc 2018-06-27 12:38:52 +08:00
PeiUsbLib.c MdeModulePkg XhciPei/UsbBusPei: Add XHCI recovery support. 2014-07-02 03:20:49 +00:00
PeiUsbLib.h MdeModulePkg XhciPei/UsbBusPei: Add XHCI recovery support. 2014-07-02 03:20:49 +00:00
UsbBusPei.inf MdeModulePkg: INF/DEC file updates to EDK II packages 2014-08-28 06:34:06 +00:00
UsbBusPei.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UsbBusPeiExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00
UsbIoPeim.c MdeModulePkg XhciPei/UsbBusPei: Add XHCI recovery support. 2014-07-02 03:20:49 +00:00
UsbPeim.c MdeModulePkg/Usb: Fix wrong condition judgment to support usb3.1 dev 2016-04-21 15:53:14 +08:00
UsbPeim.h MdeModulePkg XhciPei/UsbBusPei: Enhance code for better device compatibility. 2014-09-15 09:33:16 +00:00