From d19cc061d07d9596a6d88d4812036f1233d55312 Mon Sep 17 00:00:00 2001 From: Stefanie Dukovac Date: Mon, 16 Dec 2024 15:17:38 -0500 Subject: [PATCH] boot: Check LoadOptions against FilePath for uki pxe boot --- src/boot/stub.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/boot/stub.c b/src/boot/stub.c index cf990df2e73..e9307167398 100644 --- a/src/boot/stub.c +++ b/src/boot/stub.c @@ -257,6 +257,16 @@ static void process_arguments( * it could actually be anything! */ char16_t *c = xstrndup16(loaded_image->LoadOptions, loaded_image->LoadOptionsSize / sizeof(char16_t)); parse_profile_from_cmdline(&c, ret_profile); + + /* Ignore LoadOptions if matches loaded image FilePath for uki pxe */ + if (loaded_image->FilePath) { + _cleanup_free_ char16_t *s = NULL; + if (device_path_to_str(loaded_image->FilePath, &s) == EFI_SUCCESS && !strcmp16(s, c)) { + mfree(c); + c = NULL; + } + } + *ret_cmdline = mangle_stub_cmdline(c); return; }