public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] efi/libstub: fix efi_parse_options() ignoring the default command line
@ 2024-10-11 22:48 Jonathan Marek
  2024-10-11 22:48 ` [PATCH 2/3] efi/libstub: remove uneccessary cmdline_size init/check Jonathan Marek
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Jonathan Marek @ 2024-10-11 22:48 UTC (permalink / raw)
  To: linux-efi
  Cc: Ard Biesheuvel, Kuppuswamy Sathyanarayanan, Ingo Molnar,
	open list

efi_convert_cmdline() always returns a size of at least 1 because it counts
the NUL terminator, so the "cmdline_size == 0" condition is not possible.

Change it to compare against 1 to get the intended behavior: to use
CONFIG_CMDLINE when load_options_size is 0.

Fixes: 60f38de7a8d4 ("efi/libstub: Unify command line param parsing")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
---
 drivers/firmware/efi/libstub/efi-stub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index 958a680e0660d..709ae2d41a632 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -129,7 +129,7 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)
 
 	if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) ||
 	    IS_ENABLED(CONFIG_CMDLINE_FORCE) ||
-	    cmdline_size == 0) {
+	    cmdline_size == 1) {
 		status = efi_parse_options(CONFIG_CMDLINE);
 		if (status != EFI_SUCCESS) {
 			efi_err("Failed to parse options\n");
-- 
2.45.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-10-15  2:09 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11 22:48 [PATCH 1/3] efi/libstub: fix efi_parse_options() ignoring the default command line Jonathan Marek
2024-10-11 22:48 ` [PATCH 2/3] efi/libstub: remove uneccessary cmdline_size init/check Jonathan Marek
2024-10-12  7:49   ` Ard Biesheuvel
2024-10-11 22:48 ` [PATCH 3/3] efi/libstub: consider CONFIG_CMDLINE for initrd= and dtb= options Jonathan Marek
2024-10-12  7:54   ` Ard Biesheuvel
2024-10-12 12:00     ` Jonathan Marek
2024-10-12 13:36       ` Ard Biesheuvel
2024-10-12 14:07         ` Jonathan Marek
2024-10-12 14:50           ` Ard Biesheuvel
2024-10-12 15:00             ` Jonathan Marek
2024-10-15  0:13   ` kernel test robot
2024-10-15  2:08   ` kernel test robot
2024-10-12  7:46 ` [PATCH 1/3] efi/libstub: fix efi_parse_options() ignoring the default command line Ard Biesheuvel
2024-10-12 11:55   ` Jonathan Marek
2024-10-12 13:15     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox