Skip to content

Commit

Permalink
efi/libstub: Zero initialize heap allocated struct screen_info
Browse files Browse the repository at this point in the history
commit ee8b8f5 upstream.

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 <[email protected]>
Cc: <[email protected]> # v6.6+
Fixes: 732ea9d ("efi: libstub: Move screen_info handling to common code")
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
JohnsPony authored and gregkh committed Aug 3, 2024
1 parent 5a9a5f3 commit 242cda6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/firmware/efi/libstub/screen_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 242cda6

Please sign in to comment.