Reviewed-by: Liming Gao <[email protected]> > -----邮件原件----- > 发件人: [email protected] <[email protected]> 代表 Gerd > Hoffmann > 发送时间: 2022年1月21日 20:59 > 收件人: [email protected] > 抄送: Dandan Bi <[email protected]>; Pawel Polawski > <[email protected]>; Jian J Wang <[email protected]>; Liming Gao > <[email protected]>; Gerd Hoffmann <[email protected]> > 主题: [edk2-devel] [PATCH 1/1] 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 <[email protected]> > --- > MdeModulePkg/Core/RuntimeDxe/Runtime.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Core/RuntimeDxe/Runtime.c > b/MdeModulePkg/Core/RuntimeDxe/Runtime.c > index 2a541408731d..de8f2bfce0f8 100644 > --- a/MdeModulePkg/Core/RuntimeDxe/Runtime.c > +++ b/MdeModulePkg/Core/RuntimeDxe/Runtime.c > @@ -365,7 +365,8 @@ RuntimeDriverSetVirtualAddressMap ( > // > // mVirtualMap is only valid during SetVirtualAddressMap() call > // > - mVirtualMap = NULL; > + mVirtualMap = NULL; > + mVirtualMapMaxIndex = 0; > > return EFI_SUCCESS; > } > -- > 2.34.1 > > > > >
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86134): https://edk2.groups.io/g/devel/message/86134 Mute This Topic: https://groups.io/mt/88739661/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
