[PATCH] kernel-stub: Warn when command line options are detected

1 view
Skip to first unread message

Jan Kiszka

unread,
May 2, 2022, 2:16:49 AM5/2/22
to efibootguard-dev, Christian Storm
From: Jan Kiszka <jan.k...@siemens.com>

The kernel stub does no support options passed on load and will always
use the built-in ones or none if they are empty. Warn when someone tries
to pass some nevertheless to avoid surprises.

Suggested-by: Christian Storm <christi...@siemens.com>
Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
kernel-stub/main.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/kernel-stub/main.c b/kernel-stub/main.c
index 36249b4..95a9593 100644
--- a/kernel-stub/main.c
+++ b/kernel-stub/main.c
@@ -111,6 +111,11 @@ EFI_STATUS efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table)
error_exit(L"Error getting LoadedImageProtocol", status);
}

+ /* consider zero-termination for string length */
+ if (stub_image->LoadOptionsSize > sizeof(CHAR16)) {
+ info(L"WARNING: Passed command line options ignored, only built-in used");
+ }
+
pe_header = get_pe_header(stub_image->ImageBase);
for (n = 0, section = get_sections(pe_header);
n < pe_header->Coff.NumberOfSections;
--
2.34.1
Reply all
Reply to author
Forward
0 new messages