]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Core/RuntimeDxe/Runtime.c
MdeModulePkg/RuntimeDxe: clear mVirtualMapMaxIndex
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 21 Jan 2022 12:58:48 +0000 (20:58 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 7 Feb 2022 05:31:17 +0000 (05:31 +0000)
commitf78b937c95ddc4f7a29e41fee98e96076828a108
tree4683734f86ed4cbfa5041bd469c7c4797883542f
parentd4ac53aa91b8a3602166c6adcb9ba8678e0ae969
MdeModulePkg/RuntimeDxe: clear mVirtualMapMaxIndex

When setting mVirtualMap to NULL also set mVirtualMapMaxIndex to 0.
Without that RuntimeDriverConvertPointer() will go search the ZeroPage
for EFI_MEMORY_DESCRIPTOR entries.

In case mVirtualMapMaxIndex happens to be small small enough that'll go
unnoticed, the search will not find anything and EFI_NOT_FOUND will be
returned.

In case mVirtualMapMaxIndex is big enough the search will reach the end
of the ZeroPage and trigger a page fault.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
MdeModulePkg/Core/RuntimeDxe/Runtime.c