Blame SOURCES/0011-Don-t-hook-system-services-if-shim-has-no-built-in-k.patch

4210fa
From 8b48ec5c70cd97d37f48581a4eab8139c1a95a1f Mon Sep 17 00:00:00 2001
4210fa
From: Matthew Garrett <matthew.garrett@nebula.com>
4210fa
Date: Tue, 19 Nov 2013 10:15:55 -0500
4210fa
Subject: [PATCH 11/74] Don't hook system services if shim has no built-in keys
4210fa
4210fa
Shim should only need to enforce its security policy when its launching
4210fa
binaries signed with its built-in key. Binaries signed by keys in db or
4210fa
Mokdb should be able to rely on their own security policy.
4210fa
4210fa
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
4210fa
---
4210fa
 shim.c | 14 +++++++++-----
4210fa
 1 file changed, 9 insertions(+), 5 deletions(-)
4210fa
4210fa
diff --git a/shim.c b/shim.c
4210fa
index 524f5fc..cf93d65 100644
4210fa
--- a/shim.c
4210fa
+++ b/shim.c
4210fa
@@ -1757,11 +1757,15 @@ EFI_STATUS efi_main (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *passed_systab)
4210fa
 		Print(L"Booting in insecure mode\n");
4210fa
 		uefi_call_wrapper(BS->Stall, 1, 2000000);
4210fa
 	} else if (secure_mode()) {
4210fa
-		/*
4210fa
-		 * Install our hooks for ExitBootServices() and StartImage()
4210fa
-		 */
4210fa
-		hook_system_services(systab);
4210fa
-		loader_is_participating = 0;
4210fa
+		if (vendor_cert_size || vendor_dbx_size) {
4210fa
+			/*
4210fa
+			 * If shim includes its own certificates then ensure
4210fa
+			 * that anything it boots has performed some
4210fa
+			 * validation of the next image.
4210fa
+			 */
4210fa
+			hook_system_services(systab);
4210fa
+			loader_is_participating = 0;
4210fa
+		}
4210fa
 	}
4210fa
 
4210fa
 	/*
4210fa
-- 
4210fa
1.9.3
4210fa