Skip to content

Commit 8510622

Browse files
committed
efi/libstub: Take command line overrides into account for loaded files
When CONFIG_CMDLINE_OVERRIDE or CONFIG_CMDLINE_FORCE are configured, the command line provided by the boot stack should be ignored, and only the built-in command line should be taken into account. Add the required handling of this when dealing with initrd= or dtb= command line options in the EFI stub. Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 80d01ce commit 8510622

File tree

1 file changed

+2
-1
lines changed
  • drivers/firmware/efi/libstub

1 file changed

+2
-1
lines changed

drivers/firmware/efi/libstub/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ efi_status_t handle_cmdline_files(efi_loaded_image_t *image,
195195
unsigned long *load_addr,
196196
unsigned long *load_size)
197197
{
198-
const bool ignore_load_options = false;
198+
const bool ignore_load_options = IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) ||
199+
IS_ENABLED(CONFIG_CMDLINE_FORCE);
199200
const efi_char16_t *cmdline = efi_table_attr(image, load_options);
200201
u32 cmdline_len = efi_table_attr(image, load_options_size);
201202
unsigned long efi_chunk_size = ULONG_MAX;

0 commit comments

Comments
 (0)