linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] efi: Suppress spurious "Couldn't get size" error
@ 2020-02-17 15:45 Takashi Iwai
  2020-02-17 16:06 ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2020-02-17 15:45 UTC (permalink / raw)
  To: linux-efi; +Cc: Joey Lee, Ard Biesheuvel, linux-security-module, inux-kernel

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.

Link: https://lore.kernel.org/linux-efi/20190322103350.27764-2-jlee@suse.com/
Cc: Joey Lee <jlee@suse.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 security/integrity/platform_certs/load_uefi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
index 111898aad56e..8501ea62cb3e 100644
--- a/security/integrity/platform_certs/load_uefi.c
+++ b/security/integrity/platform_certs/load_uefi.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] efi: Suppress spurious "Couldn't get size" error
  2020-02-17 15:45 [PATCH] efi: Suppress spurious "Couldn't get size" error Takashi Iwai
@ 2020-02-17 16:06 ` Ard Biesheuvel
  2020-02-17 16:10   ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2020-02-17 16:06 UTC (permalink / raw)
  To: Takashi Iwai, Javier Martinez Canillas
  Cc: linux-efi, Joey Lee, linux-security-module

On Mon, 17 Feb 2020 at 16:45, Takashi Iwai <tiwai@suse.de> wrote:
>
> 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.
>
> Link: https://lore.kernel.org/linux-efi/20190322103350.27764-2-jlee@suse.com/
> Cc: Joey Lee <jlee@suse.com>
> Signed-off-by: Takashi Iwai <tiwai@suse.de>

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

-- 
Ard.


> ---
>  security/integrity/platform_certs/load_uefi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/security/integrity/platform_certs/load_uefi.c b/security/integrity/platform_certs/load_uefi.c
> index 111898aad56e..8501ea62cb3e 100644
> --- a/security/integrity/platform_certs/load_uefi.c
> +++ b/security/integrity/platform_certs/load_uefi.c
> @@ -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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] efi: Suppress spurious "Couldn't get size" error
  2020-02-17 16:06 ` Ard Biesheuvel
@ 2020-02-17 16:10   ` Takashi Iwai
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2020-02-17 16:10 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Javier Martinez Canillas, linux-efi, Joey Lee, linux-security-module

On Mon, 17 Feb 2020 17:06:57 +0100,
Ard Biesheuvel wrote:
> 
> On Mon, 17 Feb 2020 at 16:45, Takashi Iwai <tiwai@suse.de> wrote:
> >
> > 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.
> >
> > Link: https://lore.kernel.org/linux-efi/20190322103350.27764-2-jlee@suse.com/
> > Cc: Joey Lee <jlee@suse.com>
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> 
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-17 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-17 15:45 [PATCH] efi: Suppress spurious "Couldn't get size" error Takashi Iwai
2020-02-17 16:06 ` Ard Biesheuvel
2020-02-17 16:10   ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).