From 5233d3cf5e4cfe77a2e918c9c5db9b739269e690 Mon Sep 17 00:00:00 2001 From: Lans Zhang Date: Fri, 30 Jun 2017 17:06:07 +0800 Subject: shim: fix OVMF crash - httpboot.o cannot be built if ".PRECIOUS: " is placed ahead of "CFLAGS +=". - uri pointer should not be freed if NULL. Signed-off-by: Lans Zhang --- ...6-Prevent-from-removing-intermediate-.efi.patch | 22 +++++++-------- .../shim/shim/0013-httpboot-fix-OVMF-crash.patch | 32 ++++++++++++++++++++++ meta-efi-secure-boot/recipes-bsp/shim/shim_git.bb | 4 +-- 3 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 meta-efi-secure-boot/recipes-bsp/shim/shim/0013-httpboot-fix-OVMF-crash.patch (limited to 'meta-efi-secure-boot') diff --git a/meta-efi-secure-boot/recipes-bsp/shim/shim/0006-Prevent-from-removing-intermediate-.efi.patch b/meta-efi-secure-boot/recipes-bsp/shim/shim/0006-Prevent-from-removing-intermediate-.efi.patch index fbbf94b..970c992 100644 --- a/meta-efi-secure-boot/recipes-bsp/shim/shim/0006-Prevent-from-removing-intermediate-.efi.patch +++ b/meta-efi-secure-boot/recipes-bsp/shim/shim/0006-Prevent-from-removing-intermediate-.efi.patch @@ -1,7 +1,7 @@ -From 1f03018aa0b7df2eab576d410ec88e8cf66b06e0 Mon Sep 17 00:00:00 2001 +From 8cfbeee2979f0049bf018f207afc01b55d1a7bcd Mon Sep 17 00:00:00 2001 From: Lans Zhang -Date: Wed, 21 Sep 2016 11:25:14 +0800 -Subject: [PATCH 06/11] Prevent from removing intermediate .efi +Date: Fri, 30 Jun 2017 16:59:34 +0800 +Subject: [PATCH] Prevent from removing intermediate .efi Upstream-Status: Pending @@ -16,18 +16,18 @@ Signed-off-by: Lans Zhang 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile -index efab050..7c71993 100644 +index 0497e4d..19e1b4f 100644 --- a/Makefile +++ b/Makefile -@@ -100,6 +100,8 @@ MOK_SOURCES = MokManager.c shim.h include/console.h PasswordCrypt.c PasswordCryp - FALLBACK_OBJS = fallback.o - FALLBACK_SRCS = fallback.c +@@ -108,6 +108,8 @@ ifneq ($(origin ENABLE_HTTPBOOT), undefined) + SOURCES += httpboot.c httpboot.h + endif +.PRECIOUS: $(MMNAME).efi $(FBNAME).efi + - ifneq ($(origin ENABLE_HTTPBOOT), undefined) - OBJS += httpboot.o - SOURCES += httpboot.c httpboot.h + all: $(TARGET) + + shim.crt shim.key: -- -2.11.0 +2.7.5 diff --git a/meta-efi-secure-boot/recipes-bsp/shim/shim/0013-httpboot-fix-OVMF-crash.patch b/meta-efi-secure-boot/recipes-bsp/shim/shim/0013-httpboot-fix-OVMF-crash.patch new file mode 100644 index 0000000..539dc36 --- /dev/null +++ b/meta-efi-secure-boot/recipes-bsp/shim/shim/0013-httpboot-fix-OVMF-crash.patch @@ -0,0 +1,32 @@ +From 9c1636249d1bb8e0e7d108309b2747c6ede62cbb Mon Sep 17 00:00:00 2001 +From: Lans Zhang +Date: Fri, 30 Jun 2017 15:50:24 +0800 +Subject: [PATCH] httpboot: fix OVMF crash + +This is a typical typo. The free operation should be done if uri +was allocated. + +Signed-off-by: Lans Zhang +--- + httpboot.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/httpboot.c b/httpboot.c +index f8fbc73..e4657c1 100644 +--- a/httpboot.c ++++ b/httpboot.c +@@ -110,8 +110,10 @@ find_httpboot (EFI_HANDLE device) + URI_DEVICE_PATH *UriNode; + UINTN uri_size; + +- if (!uri) ++ if (uri) { + FreePool(uri); ++ uri = NULL; ++ } + + devpath = DevicePathFromHandle(device); + if (!devpath) { +-- +2.7.5 + diff --git a/meta-efi-secure-boot/recipes-bsp/shim/shim_git.bb b/meta-efi-secure-boot/recipes-bsp/shim/shim_git.bb index 5ceac6f..f5e274b 100644 --- a/meta-efi-secure-boot/recipes-bsp/shim/shim_git.bb +++ b/meta-efi-secure-boot/recipes-bsp/shim/shim_git.bb @@ -28,6 +28,7 @@ SRC_URI = "\ file://0010-Makefile-do-not-sign-the-efi-file.patch \ file://0011-Update-verification_method-if-the-loaded-image-is-si.patch;apply=0 \ file://0012-netboot-replace-the-depreciated-EFI_PXE_BASE_CODE.patch \ + file://0013-httpboot-fix-OVMF-crash.patch \ " SRC_URI_append_x86-64 = "\ ${@bb.utils.contains('DISTRO_FEATURES', 'msft', \ @@ -35,7 +36,7 @@ SRC_URI_append_x86-64 = "\ if uks_signing_model(d) == 'sample' else '', '', d)} \ " -SRCREV = "55c65546e46a78edbe41e88cb4ccbd2522e09625" +SRCREV = "919c17a45fe722dcc2b9bdaba538c738f97f88cd" S = "${WORKDIR}/git" @@ -57,7 +58,6 @@ EXTRA_OEMAKE = "\ AR=${AR} \ ${@'VENDOR_CERT_FILE=${WORKDIR}/vendor_cert.cer' if d.getVar('MOK_SB', True) == '1' else ''} \ ${@'VENDOR_DBX_FILE=${WORKDIR}/vendor_dbx.esl' if uks_signing_model(d) == 'user' else ''} \ - ENABLE_HTTPBOOT=1 \ " PARALLEL_MAKE = "" -- cgit v1.2.3-54-g00ecf