summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-10-13 13:10:38 +0200
committerArd Biesheuvel <ardb@kernel.org>2024-11-17 08:54:01 +0100
commit851062278436c9a887749e7b73598a28dd902ac0 (patch)
tree1d243b6c6fd149f51653ff4a733358e928d5eedf
parent80d01ce607cbffd8fa6ceb8a91ce07667bc51d5a (diff)
downloadlwn-851062278436c9a887749e7b73598a28dd902ac0.tar.gz
lwn-851062278436c9a887749e7b73598a28dd902ac0.zip
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 <ardb@kernel.org>
-rw-r--r--drivers/firmware/efi/libstub/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/file.c b/drivers/firmware/efi/libstub/file.c
index 33d45d1b274c..bd626d55dcbc 100644
--- a/drivers/firmware/efi/libstub/file.c
+++ b/drivers/firmware/efi/libstub/file.c
@@ -195,7 +195,8 @@ efi_status_t handle_cmdline_files(efi_loaded_image_t *image,
unsigned long *load_addr,
unsigned long *load_size)
{
- const bool ignore_load_options = false;
+ const bool ignore_load_options = IS_ENABLED(CONFIG_CMDLINE_OVERRIDE) ||
+ IS_ENABLED(CONFIG_CMDLINE_FORCE);
const efi_char16_t *cmdline = efi_table_attr(image, load_options);
u32 cmdline_len = efi_table_attr(image, load_options_size);
unsigned long efi_chunk_size = ULONG_MAX;