[edk2-devel] LoadImage in EFI_BOOT_SERVICES returning Access Denied

Gabriel Carvalho de Faria via groups.io gabriel.defaria=fit-tecnologia.org.br at groups.io
Mon Feb 21 15:21:06 UTC 2022


Greetings!

We implemented a driver that runs an EFI application on the system using the LoadImage and StartImage functions present in the EFI_BOOT_SERVICES (gBS) structure.
The source code of the main function that performs the load and start of the EFI application is presented below:
/*
* EFI Application
*/
EFI_STATUS
StartEfiApplication(VOID)
{
EFI_STATUS Status = EFI_SUCCESS;
EFI_HANDLE InMemoryImageHandle = NULL;

if(AppData == NULL || AppSize == 0) {
Status = EFI_NOT_READY;
goto FINISH;
}

// Access Denied error occurs after this call
Status = gBS->LoadImage(FALSE, gImageHandle, NULL,
AppData, AppSize, &InMemoryImageHandle);
if(EFI_ERROR(Status)) {
goto FINISH;
}

Status = gBS->StartImage(InMemoryImageHandle, NULL, NULL);

FINISH:
return Status;
} When we tested this driver, loading it in the EFI Shell, several systems were able to execute the EFI application after loading the driver, however, on a specific system, the LoadImage function returns the status of Access Denied.
After an investigation we found that this scenario might be related to Secure Boot, but we are testing with it disabled and the behavior is the same.

Would you have any other suggestions for solving this scenario?

Best regards!
Gabriel


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#86836): https://edk2.groups.io/g/devel/message/86836
Mute This Topic: https://groups.io/mt/89295704/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/edk2-devel-archive/attachments/20220221/13369b26/attachment.htm>


More information about the edk2-devel-archive mailing list