]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg/NonDiscoverable: fix memory override bug
authorHeyi Guo <heyi.guo@linaro.org>
Mon, 30 Oct 2017 05:47:52 +0000 (13:47 +0800)
committerStar Zeng <star.zeng@intel.com>
Wed, 8 Nov 2017 04:52:04 +0000 (12:52 +0800)
commit710d9e69fae6753a1a826aa18dd37bcadd3e0c3e
tree8838d146c3736f3753f32b9e45e766ce2823f078
parent400a59737fc3d14b0acc0b0a66a294bb6db894b6
MdeModulePkg/NonDiscoverable: fix memory override bug

For PciIoPciRead interface, memory prior to Buffer would be written
with zeros if Offset was larger than sizeof (Dev->ConfigSpace), which
would cause serious system exception.

So we add a pre-check branch to avoid memory override.

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c