Skip to contentSkip to conversation

efi: Allow some cert-related UEFI variables to not be present

PATCH New [email protected] 1 participant 1 message Jan 5, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: Allow some cert-related UEFI variables to not be present

From: Ignat Loskutov <[email protected]>

get_cert_list() prints an error message if no UEFI variable exists with the given name. However, the calling code doesn't always consider this an error. Fix by returning silently in this case.

---
 security/integrity/platform_certs/load_uefi.c | 2 ++
 1 file changed, 2 insertions(+)
security/integrity/platform_certs/load_uefi.c +2 -0
index 111898aad56e..163ede8d2abc 100644
@@ -43,6 +43,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
 	void *db;
 
 	status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb);
+	if (status == EFI_NOT_FOUND)
+		return NULL;
 	if (status != EFI_BUFFER_TOO_SMALL) {
 		pr_err("Couldn't get size: 0x%lx\n", status);
 		return NULL;
Signature · 1 line
2.20.1