0ad9385
From 71db1b222ecdf6cb4356f6f1e2bd45cd2f0e85e1 Mon Sep 17 00:00:00 2001
0ad9385
From: Laura Abbott <labbott@redhat.com>
0ad9385
Date: Tue, 18 Oct 2016 13:58:44 -0700
0ad9385
Subject: [PATCH] MODSIGN: Don't try secure boot if EFI runtime is disabled
0ad9385
0ad9385
Secure boot depends on having EFI runtime variable access. The code
0ad9385
does not handle a lack of runtime variables gracefully. Add a check
0ad9385
to just bail out of EFI runtime is disabled.
0ad9385
0ad9385
Signed-off-by: Laura Abbott <labbott@redhat.com>
0ad9385
---
0ad9385
 kernel/modsign_uefi.c | 4 ++++
0ad9385
 1 file changed, 4 insertions(+)
0ad9385
0ad9385
diff --git a/kernel/modsign_uefi.c b/kernel/modsign_uefi.c
0ad9385
index a41da14..2bdaf76 100644
0ad9385
--- a/kernel/modsign_uefi.c
0ad9385
+++ b/kernel/modsign_uefi.c
0ad9385
@@ -71,6 +71,10 @@ static int __init load_uefi_certs(void)
0ad9385
 	if (!efi_enabled(EFI_SECURE_BOOT))
0ad9385
 		return 0;
0ad9385
 
0ad9385
+	/* Things blow up if efi runtime is disabled */
0ad9385
+	if (efi_runtime_disabled())
0ad9385
+		return 0;
0ad9385
+
0ad9385
 	keyring = get_system_keyring();
0ad9385
 	if (!keyring) {
0ad9385
 		pr_err("MODSIGN: Couldn't get system keyring\n");
0ad9385
-- 
0ad9385
2.7.4
0ad9385