mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-06-05 09:47:31 +00:00
Unhook system services as we exit.
If we never find a valid thing to boot, we need to undo the weird things we've done. Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
3c0ee51ad8
commit
f95ccd0a7f
@ -66,7 +66,7 @@ static typeof(systab->BootServices->ExitBootServices) system_exit_boot_services;
|
||||
|
||||
extern UINT8 insecure_mode;
|
||||
|
||||
static void
|
||||
void
|
||||
unhook_system_services(void)
|
||||
{
|
||||
if (insecure_mode)
|
||||
|
@ -39,5 +39,6 @@ extern verification_method_t verification_method;
|
||||
extern int loader_is_participating;
|
||||
|
||||
extern void hook_system_services(EFI_SYSTEM_TABLE *local_systab);
|
||||
extern void unhook_system_services(void);
|
||||
|
||||
#endif /* SHIM_REPLACEMENTS_H */
|
||||
|
18
shim.c
18
shim.c
@ -1767,12 +1767,6 @@ EFI_STATUS efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *passed_systab)
|
||||
|
||||
efi_status = init_grub(image_handle);
|
||||
|
||||
/*
|
||||
* If we're back here then clean everything up before exiting
|
||||
*/
|
||||
uefi_call_wrapper(BS->UninstallProtocolInterface, 3, handle,
|
||||
&shim_lock_guid, &shim_lock_interface);
|
||||
|
||||
#if defined(OVERRIDE_SECURITY_POLICY)
|
||||
/*
|
||||
* Clean up the security protocol hook
|
||||
@ -1780,6 +1774,18 @@ EFI_STATUS efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *passed_systab)
|
||||
security_policy_uninstall();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If we're back here then clean everything up before exiting
|
||||
*/
|
||||
uefi_call_wrapper(BS->UninstallProtocolInterface, 3, handle,
|
||||
&shim_lock_guid, &shim_lock_interface);
|
||||
|
||||
|
||||
/*
|
||||
* Remove our hooks from system services.
|
||||
*/
|
||||
unhook_system_services();
|
||||
|
||||
/*
|
||||
* Free the space allocated for the alternative 2nd stage loader
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user