diff options
author | Qiang Ma <maqianga@uniontech.com> | 2024-07-17 15:00:43 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-03 08:54:22 +0200 |
commit | f17cbe55458522011fd062d4d17d7a98d08243c1 (patch) | |
tree | a33359b93134a06bbe5c9cf25887d2c0fa8d71cd | |
parent | ea4f77946226da1ae65e43718ef19e2d45c9da45 (diff) |
efi/libstub: Zero initialize heap allocated struct screen_info
commit ee8b8f5d83eb2c9caaebcf633310905ee76856e9 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 <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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/firmware/efi/libstub/screen_info.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/firmware/efi/libstub/screen_info.c b/drivers/firmware/efi/libstub/screen_info.c index a51ec201ca3cb..5d3a1e32d1776 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) |