Skip to contentSkip to conversation

efi: Suppress spurious "Couldn't get size" error

PATCH In review Takashi Iwai 2 participants 3 messages Feb 17, 2020

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

PATCH 1/1 efi: Suppress spurious "Couldn't get size" error

The current efi code emits the error message like
Couldn't get size: 0x800000000000000e
on various Dell and other machines. Although the whole problem is the buggy firmware, showing this as an error level is rather annoying, as the error message appears over the boot splash. Basically this is the result of missing entry and we have no explicit way to fix it for such a firmware problem, the error message may be suppressed.

This patch changes the error print condition and suppresses the error message if status is EFI_NOT_FOUND. It's a partial patch from the more comprehensive one Joey Lee submitted in the past.

---
 security/integrity/platform_certs/load_uefi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
security/integrity/platform_certs/load_uefi.c +2 -1
index 111898aad56e..8501ea62cb3e 100644
@@ -44,7 +44,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
 
 	status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb);
 	if (status != EFI_BUFFER_TOO_SMALL) {
-		pr_err("Couldn't get size: 0x%lx\n", status);
+		if (status != EFI_NOT_FOUND)
+			pr_err("Couldn't get size: 0x%lx\n", status);
 		return NULL;
 	}
 
Signature · 1 line
2.16.4
#1 lore raw
Quoted 9 lines · Takashi Iwai

The current efi code emits the error message like
Couldn't get size: 0x800000000000000e
on various Dell and other machines. Although the whole problem is the buggy firmware, showing this as an error level is rather annoying, as the error message appears over the boot splash. Basically this is the result of missing entry and we have no explicit way to fix it for such a firmware problem, the error message may be suppressed.

Quoted 7 lines

This patch changes the error print condition and suppresses the error message if status is EFI_NOT_FOUND. It's a partial patch from the more comprehensive one Joey Lee submitted in the past.

Hello Takashi,

Javier sent a more comprehensive fix for this today. The problem is not buggy firmware, but buggy kernel :-)
(the code assumes that all systems boot via shim, and that certain EFI variables are therefore guaranteed to exist, which is not the case)

https://lore.kernel.org/linux-efi/CAKv+Gu-a5Bo9i=K55pa3jEXRq-u5JYVGp1jFEE=UY5B=6eUkRQ@mail.gmail.com

Signature · 1 line
Ard.
Quoted 21 lines
---
 security/integrity/platform_certs/load_uefi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
security/integrity/platform_certs/load_uefi.c +2 -2
index 111898aad56e..8501ea62cb3e 100644
@@ -44,7 +44,8 @@ static __init void *get_cert_list(efi_char16_t *name, efi_guid_t *guid,
 
        status = efi.get_variable(name, guid, NULL, &lsize, &tmpdb);
        if (status != EFI_BUFFER_TOO_SMALL) {
-               pr_err("Couldn't get size: 0x%lx\n", status);
+               if (status != EFI_NOT_FOUND)
+                       pr_err("Couldn't get size: 0x%lx\n", status);
                return NULL;
        }
 
--

2.16.4

#2 lore raw
Quoted 19 lines · Ard Biesheuvel
Quoted 9 lines · Takashi Iwai

The current efi code emits the error message like
Couldn't get size: 0x800000000000000e
on various Dell and other machines. Although the whole problem is the buggy firmware, showing this as an error level is rather annoying, as the error message appears over the boot splash. Basically this is the result of missing entry and we have no explicit way to fix it for such a firmware problem, the error message may be suppressed.

Quoted 7 lines

This patch changes the error print condition and suppresses the error message if status is EFI_NOT_FOUND. It's a partial patch from the more comprehensive one Joey Lee submitted in the past.

Quoted 8 lines

Hello Takashi,

Javier sent a more comprehensive fix for this today. The problem is not buggy firmware, but buggy kernel :-)
(the code assumes that all systems boot via shim, and that certain EFI variables are therefore guaranteed to exist, which is not the case)

https://lore.kernel.org/linux-efi/CAKv+Gu-a5Bo9i=K55pa3jEXRq-u5JYVGp1jFEE=UY5B=6eUkRQ@mail.gmail.com

Awesome, then please scratch mine.
Thanks!

Takashi