Justin Vreeland 794d92
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
Justin Vreeland 794d92
From: Peter Jones <pjones@redhat.com>
Justin Vreeland 794d92
Date: Mon, 2 Oct 2017 18:18:30 -0400
Justin Vreeland 794d92
Subject: [PATCH] Make get_cert_list() use efi_status_to_str() to print error
Justin Vreeland 794d92
 messages.
Justin Vreeland 794d92
Justin Vreeland 794d92
Upstream Status: RHEL only
Justin Vreeland 794d92
Signed-off-by: Peter Jones <pjones@redhat.com>
Justin Vreeland 794d92
Signed-off-by: Jeremy Cline <jcline@redhat.com>
Justin Vreeland 794d92
---
Justin Vreeland 794d92
 security/integrity/platform_certs/load_uefi.c | 6 ++++--
Justin Vreeland 794d92
 1 file changed, 4 insertions(+), 2 deletions(-)
Justin Vreeland 794d92
Justin Vreeland 794d92
diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
Justin Vreeland 794d92
index 253fb9a7fc98..8c95b68d86d4 100644
Justin Vreeland 794d92
--- a/security/integrity/platform_certs/load_uefi.c
Justin Vreeland 794d92
+++ b/security/integrity/platform_certs/load_uefi.c
Justin Vreeland 794d92
@@ -46,7 +46,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
Justin Vreeland 794d92
 		return NULL;
Justin Vreeland 794d92
Justin Vreeland 794d92
 	if (*status != EFI_BUFFER_TOO_SMALL) {
Justin Vreeland 794d92
-		pr_err("Couldn't get size: 0x%lx\n", *status);
Justin Vreeland 794d92
+		pr_err("Couldn't get size: %s (0x%lx)\n",
Justin Vreeland 794d92
+		       efi_status_to_str(*status), *status);
Justin Vreeland 794d92
 		return NULL;
Justin Vreeland 794d92
 	}
Justin Vreeland 794d92
Justin Vreeland 794d92
@@ -57,7 +58,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
Justin Vreeland 794d92
 	*status = efi.get_variable(name, guid, NULL, &lsize, db);
Justin Vreeland 794d92
 	if (*status != EFI_SUCCESS) {
Justin Vreeland 794d92
 		kfree(db);
Justin Vreeland 794d92
-		pr_err("Error reading db var: 0x%lx\n", *status);
Justin Vreeland 794d92
+		pr_err("Error reading db var: %s (0x%lx)\n",
Justin Vreeland 794d92
+		       efi_status_to_str(*status), *status);
Justin Vreeland 794d92
 		return NULL;
Justin Vreeland 794d92
 	}
Justin Vreeland 794d92
Justin Vreeland 794d92
-- 
Justin Vreeland 794d92
2.28.0
Justin Vreeland 794d92