All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC] efi_loader: workaround for EDK2's shell.efi
@ 2018-08-09  6:15 AKASHI Takahiro
  2018-08-09  6:55 ` Alexander Graf
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: AKASHI Takahiro @ 2018-08-09  6:15 UTC (permalink / raw)
  To: u-boot

The commit 21b3edfc964 ("efi_loader: check parameters of CreateEvent")
enforces a strict parameter check at CreateEvent().  Unfortunately,
however, EDK2's Shell.efi calls this function with notify_tpl == 0.

The patch above does right thing and we'd better fix the issue on EDK2
side, and yet we might want a workaround allowing for running un-modified
version of EDK2 in short-term solution.

The patch provides a minimum mitigation of parameter check.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 lib/efi_loader/efi_boottime.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 2281703f261..e7a19c35415 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -627,7 +627,8 @@ efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
 		return EFI_INVALID_PARAMETER;
 	}
 
-	if (is_valid_tpl(notify_tpl) != EFI_SUCCESS)
+	/* notify_tpl == 0: workaround for EDK2's Shell.efi */
+	if (notify_tpl && (is_valid_tpl(notify_tpl) != EFI_SUCCESS))
 		return EFI_INVALID_PARAMETER;
 
 	evt = calloc(1, sizeof(struct efi_event));
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-08-10  0:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09  6:15 [U-Boot] [RFC] efi_loader: workaround for EDK2's shell.efi AKASHI Takahiro
2018-08-09  6:55 ` Alexander Graf
2018-08-09  8:30   ` AKASHI Takahiro
2018-08-09 10:38     ` Alexander Graf
2018-08-09 12:21 ` Heinrich Schuchardt
2018-08-09 13:08 ` Leif Lindholm
2018-08-10  0:15   ` AKASHI Takahiro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.