Skip to content

Commit db77241

Browse files
committed
x86/boot: efistub: Assign global boot_params variable
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. Note that the decompressor and the kernel proper carry conflicting declarations for the global variable 'boot_params' so refer to it via an alias to work around this. Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 0d3ad19 commit db77241

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

drivers/firmware/efi/libstub/x86-stub.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,8 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
849849
unsigned long kernel_entry;
850850
efi_status_t status;
851851

852+
boot_params_pointer = boot_params;
853+
852854
efi_system_table = sys_table_arg;
853855
/* Check if we were booted by the EFI firmware */
854856
if (efi_system_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)

drivers/firmware/efi/libstub/x86-stub.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <linux/efi.h>
44

5+
extern struct boot_params *boot_params_pointer asm("boot_params");
6+
57
extern void trampoline_32bit_src(void *, bool);
68
extern const u16 trampoline_ljmp_imm_offset;
79

0 commit comments

Comments
 (0)