From: Marcin Wojtas Date: Tue, 25 Sep 2018 21:57:51 +0000 (+0800) Subject: MdeModulePkg: XhciDxe: Prevent illegal memory access in XhcSetHsee X-Git-Tag: edk2-stable201903~985 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=e5cd809087e5710e019d2766fab13c59a2e2ac28 MdeModulePkg: XhciDxe: Prevent illegal memory access in XhcSetHsee REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1206 Newly added XhcSetHsee() routine reads 4 bytes into a UINT16 variable causing issues on PCIE and NonDiscoverable Xhci controllers. Fix that. Cc: Ruiyu Ni Cc: Fei1 Wang Cc: Star Zeng Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas Reviewed-by: Star Zeng --- diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c index 89f073e1d8..3ed1a55f98 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c @@ -609,7 +609,7 @@ XhcSetHsee ( PciIo, EfiPciIoWidthUint16, PCI_COMMAND_OFFSET, - sizeof (XhciCmd), + sizeof (XhciCmd) / sizeof (UINT16), &XhciCmd ); if (!EFI_ERROR (Status)) {