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