x86/boot: efistub: Assign global boot_params variable
authorArd Biesheuvel <ardb@kernel.org>
Tue, 17 Oct 2023 13:25:13 +0000 (15:25 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 18 Oct 2023 10:03:04 +0000 (12:03 +0200)
Now that the x86 EFI stub calls into some APIs exposed by the
decompressor (e.g., kaslr_get_random_long()), it is necessary to ensure
that the global boot_params variable is set correctly before doing so.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org
drivers/firmware/efi/libstub/x86-stub.c

index 3bfc59637dd16201da8359e08ec2b81c804bb159..76cc0d08e68a504845477bcfcf746de39a693bbd 100644 (file)
@@ -818,6 +818,8 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
        unsigned long kernel_entry;
        efi_status_t status;
 
+       boot_params_ptr = boot_params;
+
        efi_system_table = sys_table_arg;
        /* Check if we were booted by the EFI firmware */
        if (efi_system_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)