efi_loader: correct HandleProtocol()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 1 Jun 2019 17:29:39 +0000 (19:29 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 1 Jun 2019 20:40:23 +0000 (22:40 +0200)
The UEFI specification requires that when a protocol is opened via
HandleProtocol() the agent handle is the image handle of the EFI firmware
(see chapter on EFI_BOOT_SERVICES.OpenProtocol()).

Let efi_handle_protocol() pass efi_root as agent handle to
efi_open_protocol().

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_boottime.c

index f5b5828f938e6dfb64d0c4505c226e854741bb0a..481f9b9d3e7036b9a1d7a6c5eeece5b9ba033ed1 100644 (file)
@@ -3073,7 +3073,7 @@ static efi_status_t EFIAPI efi_handle_protocol(efi_handle_t handle,
                                               const efi_guid_t *protocol,
                                               void **protocol_interface)
 {
-       return efi_open_protocol(handle, protocol, protocol_interface, NULL,
+       return efi_open_protocol(handle, protocol, protocol_interface, efi_root,
                                 NULL, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL);
 }