diff options
author | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-09-16 02:37:23 +0000 |
---|---|---|
committer | lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-09-16 02:37:23 +0000 |
commit | 919df8e6d2b8d9c9c2438c73676b8224eecc1d4b (patch) | |
tree | 1ec49ff9d0fcedfb38ab3a5a02e268b914daa579 /MdeModulePkg | |
parent | 3f42faa73de0271e8b1c98cf5544e26b1e845097 (diff) | |
download | edk2-platforms-919df8e6d2b8d9c9c2438c73676b8224eecc1d4b.tar.xz |
Enhance PeiCore and DxeCore check whether the image machine type is supported when start image.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9266 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Image/Image.c | 8 | ||||
-rw-r--r-- | MdeModulePkg/Core/Pei/Image/Image.c | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 8ec6793966..8033b449d9 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -1120,6 +1120,14 @@ CoreStartImage ( return EFI_INVALID_PARAMETER;
}
+ if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (Image->Machine)) {
+ //
+ // The image to be started must have the machine type supported by DxeCore.
+ //
+ ASSERT (FALSE);
+ return EFI_UNSUPPORTED;
+ }
+
//
// Don't profile Objects or invalid start requests
//
diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c index 03e1d86ad7..84c9e4b5bf 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -434,6 +434,13 @@ PeiLoadImage ( AuthenticationState
);
if (!EFI_ERROR (Status)) {
+ if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeCoffLoaderGetMachineType ((VOID *) (UINTN) ImageAddress))) {
+ //
+ // The image to be started must have the machine type supported by PeiCore.
+ //
+ ASSERT (FALSE);
+ return EFI_UNSUPPORTED;
+ }
return Status;
}
}
|