audk/MdeModulePkg
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
..
Application MdeModulePkg BootManagerMenuApp: Update usage info for BootLogo protocol 2018-06-05 14:23:48 +08:00
Bus MdeModulePkg UsbBusPei: Fix wrong buffer length used to read hub desc 2018-06-27 12:38:52 +08:00
Core MdeModulePkg: Use new added Perf macros 2018-06-26 15:36:59 +08:00
Include MdeModulePkg: Update performance library instances 2018-06-26 15:36:51 +08:00
Library MdeModulePkg: Use new added Perf macros 2018-06-26 15:36:59 +08:00
Logo MdeModulePkg/Logo.idf: Remove incorrect comments. 2018-02-28 15:30:23 +08:00
Universal MdeModulePkg: Use new added Perf macros 2018-06-26 15:36:59 +08:00
MdeModulePkg.dec MdeModulePkg: Add PERFORMANCE_MEASUREMENT_PROTOCOL 2018-06-26 15:36:35 +08:00
MdeModulePkg.dsc MdeModulePkg/NvmExpressPei: Add the NVME device PEI BlockIo support 2018-06-25 09:13:12 +08:00
MdeModulePkg.uni MdeModulePkg/Variable/RuntimeDxe: introduce PcdMaxVolatileVariableSize 2018-03-30 21:17:07 +02:00
MdeModulePkgExtra.uni MdeModulePkg: Convert all .uni files to utf-8 2015-12-15 04:56:23 +00:00