diff options
author | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-10 03:05:40 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-10 03:05:40 +0000 |
commit | 31222776dbf72d2953445ce4bcc735bf196e6b4f (patch) | |
tree | 791c2b5fd6e8a9d4eec755dbcd7d03d0d2789ba5 /MdeModulePkg/Core/Dxe | |
parent | e9668a606e6e518025b70487333f17e72a15b8e2 (diff) | |
download | edk2-31222776dbf72d2953445ce4bcc735bf196e6b4f.zip edk2-31222776dbf72d2953445ce4bcc735bf196e6b4f.tar.gz edk2-31222776dbf72d2953445ce4bcc735bf196e6b4f.tar.bz2 |
Set *ImageHandle to NULL when LoadImage() returns EFI_ACCESS_DENIED.
Signed-off-by: niruiyu
Reviewed-by: jljusten
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11783 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core/Dxe')
-rw-r--r-- | MdeModulePkg/Core/Dxe/Image/Image.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index c6a7081..56d93ad 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -1086,6 +1086,13 @@ CoreLoadImageCommon ( OriginalFilePath
);
if (EFI_ERROR (SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) {
+ if (SecurityStatus == EFI_ACCESS_DENIED) {
+ //
+ // Image was not loaded because the platform policy prohibits the image from being loaded.
+ // It's the only place we could meet EFI_ACCESS_DENIED.
+ //
+ *ImageHandle = NULL;
+ }
Status = SecurityStatus;
Image = NULL;
goto Done;
@@ -1237,7 +1244,6 @@ Done: if (EFI_ERROR (Status)) {
if (Image != NULL) {
CoreUnloadAndCloseImage (Image, (BOOLEAN)(DstBuffer == 0));
- *ImageHandle = NULL;
}
} else if (EFI_ERROR (SecurityStatus)) {
Status = SecurityStatus;
|