Commit bba959f4 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'efi-fixes-for-v6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi

Pull EFI fixes from Ard Biesheuvel:

 - Wipe screen_info after allocating it from the heap - used by arm32
   and EFI zboot, other EFI architectures allocate it statically

 - Revert to allocating boot_params from the heap on x86 when entering
   via the native PE entrypoint, to work around a regression on older
   Dell hardware

* tag 'efi-fixes-for-v6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
  x86/efistub: Revert to heap allocated boot_params for PE entrypoint
  efi/libstub: Zero initialize heap allocated struct screen_info
parents 9b219936 ae835a96
...@@ -32,6 +32,8 @@ struct screen_info *__alloc_screen_info(void) ...@@ -32,6 +32,8 @@ struct screen_info *__alloc_screen_info(void)
if (status != EFI_SUCCESS) if (status != EFI_SUCCESS)
return NULL; return NULL;
memset(si, 0, sizeof(*si));
status = efi_bs_call(install_configuration_table, status = efi_bs_call(install_configuration_table,
&screen_info_guid, si); &screen_info_guid, si);
if (status == EFI_SUCCESS) if (status == EFI_SUCCESS)
......
...@@ -534,11 +534,12 @@ void __noreturn efi_stub_entry(efi_handle_t handle, ...@@ -534,11 +534,12 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
efi_system_table_t *sys_table_arg) efi_system_table_t *sys_table_arg)
{ {
static struct boot_params boot_params __page_aligned_bss;
struct setup_header *hdr = &boot_params.hdr;
efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID; efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
struct boot_params *boot_params;
struct setup_header *hdr;
int options_size = 0; int options_size = 0;
efi_status_t status; efi_status_t status;
unsigned long alloc;
char *cmdline_ptr; char *cmdline_ptr;
efi_system_table = sys_table_arg; efi_system_table = sys_table_arg;
...@@ -553,6 +554,13 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, ...@@ -553,6 +554,13 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
efi_exit(handle, status); efi_exit(handle, status);
} }
status = efi_allocate_pages(PARAM_SIZE, &alloc, ULONG_MAX);
if (status != EFI_SUCCESS)
efi_exit(handle, status);
boot_params = memset((void *)alloc, 0x0, PARAM_SIZE);
hdr = &boot_params->hdr;
/* Assign the setup_header fields that the kernel actually cares about */ /* Assign the setup_header fields that the kernel actually cares about */
hdr->root_flags = 1; hdr->root_flags = 1;
hdr->vid_mode = 0xffff; hdr->vid_mode = 0xffff;
...@@ -562,13 +570,15 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, ...@@ -562,13 +570,15 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
/* Convert unicode cmdline to ascii */ /* Convert unicode cmdline to ascii */
cmdline_ptr = efi_convert_cmdline(image, &options_size); cmdline_ptr = efi_convert_cmdline(image, &options_size);
if (!cmdline_ptr) if (!cmdline_ptr) {
efi_free(PARAM_SIZE, alloc);
efi_exit(handle, EFI_OUT_OF_RESOURCES); efi_exit(handle, EFI_OUT_OF_RESOURCES);
}
efi_set_u64_split((unsigned long)cmdline_ptr, &hdr->cmd_line_ptr, efi_set_u64_split((unsigned long)cmdline_ptr, &hdr->cmd_line_ptr,
&boot_params.ext_cmd_line_ptr); &boot_params->ext_cmd_line_ptr);
efi_stub_entry(handle, sys_table_arg, &boot_params); efi_stub_entry(handle, sys_table_arg, boot_params);
/* not reached */ /* not reached */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment