summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/libstub/x86-stub.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-02-10 17:02:40 +0100
committerArd Biesheuvel <ardb@kernel.org>2020-02-23 21:57:15 +0100
commit1e45bf7372c48c78e1f7e538fd3e612946f6ad20 (patch)
tree0f80d1de04faa33c4a0d1bc55d435d35f02d4bf1 /drivers/firmware/efi/libstub/x86-stub.c
parent8166ec091573fad528d884ede291fd1ec02d0298 (diff)
efi/libstub/x86: Permit cmdline data to be allocated above 4 GB
We now support cmdline data that is located in memory that is not 32-bit addressable, so relax the allocation limit on systems where this feature is enabled. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/libstub/x86-stub.c')
-rw-r--r--drivers/firmware/efi/libstub/x86-stub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
index 9d60352baa0f..f2dbf119837c 100644
--- a/drivers/firmware/efi/libstub/x86-stub.c
+++ b/drivers/firmware/efi/libstub/x86-stub.c
@@ -405,7 +405,8 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
hdr->type_of_loader = 0x21;
/* Convert unicode cmdline to ascii */
- cmdline_ptr = efi_convert_cmdline(image, &options_size);
+ cmdline_ptr = efi_convert_cmdline(image, &options_size,
+ above4g ? ULONG_MAX : UINT_MAX);
if (!cmdline_ptr)
goto fail;
@@ -445,7 +446,7 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle,
/* not reached */
fail2:
- efi_free(options_size, hdr->cmd_line_ptr);
+ efi_free(options_size, (unsigned long)cmdline_ptr);
fail:
efi_free(0x4000, (unsigned long)boot_params);