Skip to content

Commit 0d47234

Browse files
lersekmergify[bot]
authored andcommitted
OvmfPkg/PlatformBmPrintScLib: hint at Secure Boot verification
The UEFI spec 2.11 documents EFI_SECURITY_VIOLATION for both gBS->LoadImage() and gBS->StartImage() as > [Image was loaded and an ImageHandle was created with a valid > EFI_LOADED_IMAGE_PROTOCOL. However,] the current platform policy > specifies that the image should not be started. Additionally, the spec documents EFI_ACCESS_DENIED for gBS->LoadImage() as > Image was not loaded because the platform policy prohibits the image > from being loaded. NULL is returned in ImageHandle. When image loading/starting fails under the above conditions (according to the status code being reported), print a hint about Secure Boot. This should help users diagnose and fix their Secure Boot configuration. Updates: 77874ce Fixes: #10901 Signed-off-by: Laszlo Ersek <[email protected]>
1 parent c8c65be commit 0d47234

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

OvmfPkg/Library/PlatformBmPrintScLib/StatusCodeHandler.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,20 @@ HandleStatusCode (
214214
DevPathString
215215
);
216216
} else {
217+
EFI_STATUS ReturnStatus;
218+
219+
ReturnStatus = ((EFI_RETURN_STATUS_EXTENDED_DATA *)Data)->ReturnStatus;
217220
Print (
218-
L"%a: failed to %a %s \"%s\" from %s: %r\n",
221+
L"%a: failed to %a %s \"%s\" from %s: %r%a\n",
219222
gEfiCallerBaseName,
220223
Value == mLoadFail ? "load" : "start",
221224
BootOptionName,
222225
BmBootOption.Description,
223226
DevPathString,
224-
((EFI_RETURN_STATUS_EXTENDED_DATA *)Data)->ReturnStatus
227+
ReturnStatus,
228+
((ReturnStatus == EFI_SECURITY_VIOLATION ||
229+
(Value == mLoadFail && ReturnStatus == EFI_ACCESS_DENIED)) ?
230+
" -- rejected probably by Secure Boot" : "")
225231
);
226232
}
227233

0 commit comments

Comments
 (0)