File tboot-Do-not-try-to-read-EFI-mem-map-when-booted-with-mult.patch of Package tboot.18210
From e3419cf615b395caac4c1905db1de0cf20b179c9 Mon Sep 17 00:00:00 2001
From: Lukasz Hawrylko <lukasz.hawrylko@intel.com>
Date: Wed, 3 Jun 2020 16:35:17 +0200
Subject: [PATCH] Do not try to read EFI mem map when booted with multiboot(1)
Signed-off-by: Lukasz Hawrylko <lukasz.hawrylko@intel.com>
---
tboot/common/loader.c | 7 +++++++
1 file changed, 7 insertions(+)
Index: tboot-1.9.8/tboot/common/loader.c
===================================================================
--- tboot-1.9.8.orig/tboot/common/loader.c
+++ tboot-1.9.8/tboot/common/loader.c
@@ -2009,6 +2009,13 @@ find_efi_memmap(loader_ctx *lctx, uint32
return 0;
}
+ if (LOADER_CTX_BAD(lctx) || lctx->type != MB2_ONLY) {
+ return 0;
+ }
+ if (descr_size == NULL || descr_vers == NULL || mmap_size == NULL) {
+ return 0;
+ }
+
start = (struct mb2_tag *)(lctx->addr + 8);
hit = find_mb2_tag_type(start, MB2_TAG_TYPE_EFI_MMAP);
if (hit == NULL) {