Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <maqianga@uniontech.com>
Cc: <stable@vger.kernel.org> # v6.6+
Fixes: 732ea9db9d8a ("efi: libstub: Move screen_info handling to common code")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

authored by

Qiang Ma and committed by
Ard Biesheuvel
ee8b8f5d 4a2ebb08

+2
+2
drivers/firmware/efi/libstub/screen_info.c
··· 32 32 if (status != EFI_SUCCESS) 33 33 return NULL; 34 34 35 + memset(si, 0, sizeof(*si)); 36 + 35 37 status = efi_bs_call(install_configuration_table, 36 38 &screen_info_guid, si); 37 39 if (status == EFI_SUCCESS)