mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] efi/libstub: Fixed an issue with screen_info not being initialized
@ 2024-07-17  7:00 Qiang Ma
  2024-07-17 20:53 ` Ard Biesheuvel
  0 siblings, 1 reply; 2+ messages in thread
From: Qiang Ma @ 2024-07-17  7:00 UTC (permalink / raw)
  To: ardb; +Cc: linux-efi, linux-kernel, Qiang Ma

After calling uefi interface allocate_pool to apply for memory, we
should clear 0 to prevent the possibility of using random values.

Signed-off-by: Qiang Ma <maqianga@uniontech.com>
---
 drivers/firmware/efi/libstub/screen_info.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/firmware/efi/libstub/screen_info.c b/drivers/firmware/efi/libstub/screen_info.c
index a51ec201ca3c..5d3a1e32d177 100644
--- a/drivers/firmware/efi/libstub/screen_info.c
+++ b/drivers/firmware/efi/libstub/screen_info.c
@@ -32,6 +32,8 @@ struct screen_info *__alloc_screen_info(void)
 	if (status != EFI_SUCCESS)
 		return NULL;
 
+	memset(si, 0, sizeof(*si));
+
 	status = efi_bs_call(install_configuration_table,
 			     &screen_info_guid, si);
 	if (status == EFI_SUCCESS)
-- 
2.20.1


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

* Re: [PATCH] efi/libstub: Fixed an issue with screen_info not being initialized
  2024-07-17  7:00 [PATCH] efi/libstub: Fixed an issue with screen_info not being initialized Qiang Ma
@ 2024-07-17 20:53 ` Ard Biesheuvel
  0 siblings, 0 replies; 2+ messages in thread
From: Ard Biesheuvel @ 2024-07-17 20:53 UTC (permalink / raw)
  To: Qiang Ma; +Cc: linux-efi, linux-kernel

On Wed, 17 Jul 2024 at 00:01, Qiang Ma <maqianga@uniontech.com> wrote:
>
> After calling uefi interface allocate_pool to apply for memory, we
> should clear 0 to prevent the possibility of using random values.
>
> Signed-off-by: Qiang Ma <maqianga@uniontech.com>
> ---
>  drivers/firmware/efi/libstub/screen_info.c | 2 ++
>  1 file changed, 2 insertions(+)
>

Thanks. I've queued this as a fix.

> diff --git a/drivers/firmware/efi/libstub/screen_info.c b/drivers/firmware/efi/libstub/screen_info.c
> index a51ec201ca3c..5d3a1e32d177 100644
> --- a/drivers/firmware/efi/libstub/screen_info.c
> +++ b/drivers/firmware/efi/libstub/screen_info.c
> @@ -32,6 +32,8 @@ struct screen_info *__alloc_screen_info(void)
>         if (status != EFI_SUCCESS)
>                 return NULL;
>
> +       memset(si, 0, sizeof(*si));
> +
>         status = efi_bs_call(install_configuration_table,
>                              &screen_info_guid, si);
>         if (status == EFI_SUCCESS)
> --
> 2.20.1
>

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

end of thread, other threads:[~2024-07-17 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17  7:00 [PATCH] efi/libstub: Fixed an issue with screen_info not being initialized Qiang Ma
2024-07-17 20:53 ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®