Skip to content

Commit ee8b8f5

Browse files
JohnsPonyardbiesheuvel
authored andcommitted
efi/libstub: Zero initialize heap allocated struct screen_info
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]>
1 parent 4a2ebb0 commit ee8b8f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/firmware/efi/libstub/screen_info.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ struct screen_info *__alloc_screen_info(void)
3232
if (status != EFI_SUCCESS)
3333
return NULL;
3434

35+
memset(si, 0, sizeof(*si));
36+
3537
status = efi_bs_call(install_configuration_table,
3638
&screen_info_guid, si);
3739
if (status == EFI_SUCCESS)

0 commit comments

Comments
 (0)