From: Ard Biesheuvel <ardb+git@google.com>
To: linux-efi@vger.kernel.org
Cc: Jonathan Marek <jonathan@marek.ca>, Ard Biesheuvel <ardb@kernel.org>
Subject: [PATCH 4/4] efi/libstub: Take command line overrides into account for loaded files
Date: Fri, 15 Nov 2024 10:28:42 +0100 [thread overview]
Message-ID: <20241115092838.3080857-8-ardb+git@google.com> (raw)
In-Reply-To: <20241115092838.3080857-5-ardb+git@google.com>
From: Ard Biesheuvel <ardb@kernel.org>
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>
---
drivers/firmware/efi/libstub/file.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/libstub/file.c b/drivers/firmware/efi/libstub/file.c
index 17bf25dccc07..0e41b88238b1 100644
--- a/drivers/firmware/efi/libstub/file.c
+++ b/drivers/firmware/efi/libstub/file.c
@@ -189,7 +189,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;
--
2.47.0.338.g60cca15819-goog
next prev parent reply other threads:[~2024-11-15 9:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 9:28 [PATCH 1/4] efi/libstub: Free correct pointer on failure Ard Biesheuvel
2024-11-15 9:28 ` [PATCH 2/4] efi/libstub: Parse builtin command line after bootloader provided one Ard Biesheuvel
2024-11-15 9:28 ` [PATCH 3/4] efi/libstub: Fix command line fallback handling when loading files Ard Biesheuvel
2024-11-15 9:28 ` Ard Biesheuvel [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-10-15 18:15 [PATCH 0/4] efi/libstub: Clean up command line handling Ard Biesheuvel
2024-10-15 18:15 ` [PATCH 4/4] efi/libstub: Take command line overrides into account for loaded files Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241115092838.3080857-8-ardb+git@google.com \
--to=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=jonathan@marek.ca \
--cc=linux-efi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox