!205 [sync] PR-203: Fix the issue that the gBS->LoadImage pointer was empty.

From: @openeuler-sync-bot 
Reviewed-by: @HuaxinLuGitee 
Signed-off-by: @HuaxinLuGitee
This commit is contained in:
openeuler-ci-bot 2025-02-11 08:31:05 +00:00 committed by Gitee
commit d0f5e1fb86
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 712097206702f26e96be3f7ba79eb52d00e1f658 Mon Sep 17 00:00:00 2001
From: jinlun <869793317@qq.com>
Date: Sat, 2 Nov 2024 17:21:22 +0800
Subject: [PATCH] Fix the issue that the gBS->LoadImage pointer was empty.
The interface shouldn't be replaced at the shim_fini
stage When the vendor certificate doesn't exist.
Signed-off-by: jinlun <869793317@qq.com>
Signed-off-by: xuce <xuce10@h-partners.com>
---
shim.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/shim.c b/shim.c
index 547b052..aa74610 100644
--- a/shim.c
+++ b/shim.c
@@ -1651,11 +1651,12 @@ shim_fini(void)
uninstall_shim_protocols();
if (secure_mode()) {
-
- /*
- * Remove our hooks from system services.
- */
- unhook_system_services();
+ if (vendor_authorized_size || vendor_deauthorized_size) {
+ /*
+ * Remove our hooks from system services.
+ */
+ unhook_system_services();
+ }
}
unhook_exit();
--
2.33.0

View File

@ -25,7 +25,7 @@
Name: shim
Version: 15.7
Release: 15
Release: 16
Summary: First-stage UEFI bootloader
ExclusiveArch: x86_64 aarch64
License: BSD
@ -55,6 +55,7 @@ Patch15:backport-CVE-2024-0727.patch
Patch16:backport-Always-clear-SbatLevel-when-Secure-Boot-is-disabled.patch
Patch17:backport-Align-section-size-up-to-page-size-for-mem-attrs.patch
Patch18:backport-shim-don-t-set-second_stage-to-the-empty-string.patch
Patch19:backport-Fix-the-issue-that-the-gBS-LoadImage-pointer-was-emp.patch
# Feature for shim SMx support
Patch9000:Feature-shim-openssl-add-ec-support.patch
@ -212,6 +213,9 @@ make test
/usr/src/debug/%{name}-%{version}-%{release}/*
%changelog
* Mon Jan 20 2025 xuce <xuce10@h-partners.com> -15.7-16
- fix the issue that the gBS->LoadImage pointer was empty.
* Tue Oct 29 2024 yanglongkang <yanglongkang@h-partners.com> -15.7-15
- Correct the signature code.