Skip to content

Commit 98b228f

Browse files
Roy FranzMatt Fleming
authored andcommitted
x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr
Until now, the EFI stub was only setting the 32 bit cmd_line_ptr in the setup_header structure, so on 64 bit platforms this could be truncated. This patch adds setting the upper bits of the buffer address in ext_cmd_line_ptr. This case was likely never hit, as the allocation for this buffer is done at the lowest available address. Only x86_64 kernels have this problem, as the 1-1 mapping mandated by EFI ensures that all memory is 32 bit addressable on 32 bit platforms. The EFI stub does not support mixed mode, so the 32 bit kernel on 64 bit firmware case does not need to be handled. Signed-off-by: Roy Franz <roy.franz@linaro.org> Cc: <stable@vger.kernel.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
1 parent c57dcb5 commit 98b228f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/boot/compressed/eboot.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,8 @@ struct boot_params *make_boot_params(struct efi_config *c)
11101110
if (!cmdline_ptr)
11111111
goto fail;
11121112
hdr->cmd_line_ptr = (unsigned long)cmdline_ptr;
1113+
/* Fill in upper bits of command line address, NOP on 32 bit */
1114+
boot_params->ext_cmd_line_ptr = (u64)(unsigned long)cmdline_ptr >> 32;
11131115

11141116
hdr->ramdisk_image = 0;
11151117
hdr->ramdisk_size = 0;

0 commit comments

Comments
 (0)