public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v2] MdeModulePkg: XhciDxe: Prevent illegal memory access in XhcSetHsee
@ 2018-09-25 21:57 Marcin Wojtas
  2018-09-26  0:30 ` Zeng, Star
  0 siblings, 1 reply; 5+ messages in thread
From: Marcin Wojtas @ 2018-09-25 21:57 UTC (permalink / raw)
  To: edk2-devel
  Cc: feng.tian, michael.d.kinney, liming.gao, leif.lindholm,
	ard.biesheuvel, nadavh, mw, jsd, jaz, Ruiyu Ni, Fei1 Wang,
	Star Zeng

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 <ruiyu.ni@intel.com>
Cc: Fei1 Wang <fei1.wang@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marcin Wojtas <mw@semihalf.com>
---
 MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
index 89f073e..3ed1a55 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)) {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-26 10:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-25 21:57 [PATCH v2] MdeModulePkg: XhciDxe: Prevent illegal memory access in XhcSetHsee Marcin Wojtas
2018-09-26  0:30 ` Zeng, Star
2018-09-26  0:35   ` Zeng, Star
2018-09-26  8:01     ` Ard Biesheuvel
2018-09-26  9:59       ` Zeng, Star

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox