]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Pei/Image/Image.c
Enhance PeiCore and DxeCore check whether the image machine type is supported when...
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Image / Image.c
index 03e1d86ad73a6190908bef16e775cba6e21eb0d0..84c9e4b5bf13750032e60763c8cd0bf42bfb48c1 100644 (file)
@@ -434,6 +434,13 @@ PeiLoadImage (
                           AuthenticationState\r
                           );\r
       if (!EFI_ERROR (Status)) {\r
+        if (!EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeCoffLoaderGetMachineType ((VOID *) (UINTN) ImageAddress))) {\r
+          //\r
+          // The image to be started must have the machine type supported by PeiCore.\r
+          //\r
+          ASSERT (FALSE);\r
+          return EFI_UNSUPPORTED;\r
+        }\r
         return Status;\r
       }\r
     }\r