audk/MdeModulePkg/Bus
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
..
Ata MdeModulePkg/AtaAtapiPassThru: Fix VS2010/VS2012 build failure 2018-06-19 11:00:42 +08:00
I2c/I2cDxe
Isa MdeModulePkg/Ps2Kb: ReadKeyStrokeEx always return key state 2018-02-01 14:04:02 +08:00
Pci MdeModulePkg/NvmExpressPei: Add the NVME device PEI BlockIo support 2018-06-25 09:13:12 +08:00
Scsi MdeModulePkg/ScsiDisk: Return EFI_NO_MEDIA when no media presents 2017-12-09 12:32:42 +08:00
Sd MdeModulePkg/SdDxe: Demote DEBUG print to DEBUG_BLKIO 2018-06-13 11:19:45 +08:00
Ufs MdeModulePkg/UfsBlockIoPei: Support IoMmu 2017-11-17 11:35:02 +08:00
Usb MdeModulePkg UsbBusPei: Fix wrong buffer length used to read hub desc 2018-06-27 12:38:52 +08:00