diff options
author | Star Zeng <star.zeng@intel.com> | 2018-06-25 16:44:33 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2018-06-27 12:38:47 +0800 |
commit | acebdf14c985c5c9f50b37ece0b15ada87767359 (patch) | |
tree | 08b238a884bb4b8ff223679f11adebf0eb87e437 /NetworkPkg/Udp6Dxe | |
parent | 631976706de655baa5f44ff00d69f9773ad325f3 (diff) | |
download | edk2-acebdf14c985c5c9f50b37ece0b15ada87767359.zip edk2-acebdf14c985c5c9f50b37ece0b15ada87767359.tar.gz edk2-acebdf14c985c5c9f50b37ece0b15ada87767359.tar.bz2 |
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>
Diffstat (limited to 'NetworkPkg/Udp6Dxe')
0 files changed, 0 insertions, 0 deletions