OpenCloudOS-Kernel/drivers/firmware/efi/libstub
Jonathan Marek ae0ad16260 efi/libstub: fix efi_parse_options() ignoring the default command line
[ Upstream commit aacfa0ef247b0130b7a98bb52378f8cd727a66ca ]

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

Change it to check if the string starts with a NUL character to get the
intended behavior: to use CONFIG_CMDLINE when load_options_size == 0.

Fixes: 60f38de7a8 ("efi/libstub: Unify command line param parsing")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:31:53 +01:00
..
Makefile riscv/efistub: Ensure GP-relative addressing is not used 2024-03-01 13:34:47 +01:00
Makefile.zboot efi/libstub: zboot: Avoid eager evaluation of objcopy flags 2023-05-25 09:26:00 +02:00
alignedmem.c arm64: efi: Limit allocations to 48-bit addressable physical region 2022-12-07 19:50:44 +01:00
arm32-stub.c efi: libstub: Move screen_info handling to common code 2022-11-09 12:42:02 +01:00
arm64-stub.c arm64: libstub: Move KASLR handling functions to kaslr.c 2023-09-05 19:49:29 -07:00
arm64.c efi/zboot: arm64: Grab code size from ELF symbol in payload 2023-04-26 23:06:48 +02:00
bitmap.c efi/libstub: Implement support for unaccepted memory 2023-06-06 16:58:23 +02:00
efi-stub-entry.c efi: Do not include <linux/screen_info.h> from EFI header 2023-07-08 20:26:36 +02:00
efi-stub-helper.c efi/libstub: Add generic support for parsing mem_encrypt= 2024-04-10 16:36:07 +02:00
efi-stub.c efi/libstub: fix efi_parse_options() ignoring the default command line 2024-12-09 10:31:53 +01:00
efistub.h efi/libstub: Add generic support for parsing mem_encrypt= 2024-04-10 16:36:07 +02:00
fdt.c efi: libstub: only free priv.runtime_map when allocated 2024-06-12 11:13:01 +02:00
file.c efi: libstub: Add mixed mode support to command line initrd loader 2022-11-18 09:14:08 +01:00
find.c efi/libstub: Implement support for unaccepted memory 2023-06-06 16:58:23 +02:00
gop.c
intrinsics.c efi: libstub: Clone memcmp() into the stub 2022-11-09 12:42:02 +01:00
kaslr.c x86/efistub: Avoid placing the kernel below LOAD_PHYSICAL_ADDR 2024-02-16 19:10:47 +01:00
loongarch-stub.c efi/loongarch: Directly position the loaded image file 2024-06-27 13:49:15 +02:00
loongarch-stub.h efi/loongarch: Directly position the loaded image file 2024-06-27 13:49:15 +02:00
loongarch.c LoongArch: Fix entry point in kernel image header 2024-06-27 13:49:15 +02:00
mem.c arm64: efi: Limit allocations to 48-bit addressable physical region 2022-12-07 19:50:44 +01:00
pci.c
printk.c efi: libstub: Enable efi_printk() in zboot decompressor 2022-11-09 12:42:02 +01:00
random.c efi: stub: use random seed from EFI variable 2022-12-01 09:51:21 +01:00
randomalloc.c efi/libstub: Cast away type warning in use of max() 2024-04-03 15:28:53 +02:00
relocate.c efi: libstub: install boot-time memory map as config table 2022-09-27 13:22:49 +02:00
riscv-stub.c riscv: libstub: Implement KASLR by using generic functions 2023-09-05 19:49:31 -07:00
riscv.c efi/riscv: libstub: Split off kernel image relocation for builtin stub 2022-11-09 12:42:03 +01:00
screen_info.c efi/libstub: Zero initialize heap allocated struct screen_info 2024-08-03 08:54:22 +02:00
secureboot.c efi: libstub: check Shim mode using MokSBStateRT 2022-09-22 10:15:44 +02:00
skip_spaces.c
smbios.c efi/libstub: smbios: Drop unused 'recsize' parameter 2023-03-18 11:44:57 +01:00
string.c efi: libstub: Provide local implementations of strrchr() and memchr() 2022-11-09 12:42:02 +01:00
systable.c efi/libstub: move efi_system_table global var into separate object 2022-09-19 11:19:35 +02:00
tpm.c efistub/tpm: Use ACPI reclaim memory for event log to avoid corruption 2024-10-04 16:29:52 +02:00
unaccepted_memory.c efi/unaccepted: Use ACPI reclaim memory for unaccepted memory table 2023-09-11 06:37:51 +00:00
vsprintf.c isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
x86-5lvl.c x86/efistub: Perform 4/5 level paging switch from the stub 2023-08-07 20:52:32 +02:00
x86-stub.c x86/efistub: Revert to heap allocated boot_params for PE entrypoint 2024-08-03 08:54:12 +02:00
x86-stub.h x86/efistub: Give up if memory attribute protocol returns an error 2024-02-16 19:10:46 +01:00
zboot-header.S efi/zboot: Set forward edge CFI compat header flag if supported 2023-04-20 15:45:12 +02:00
zboot.c x86/efistub: Avoid placing the kernel below LOAD_PHYSICAL_ADDR 2024-02-16 19:10:47 +01:00
zboot.lds efi/libstub: zboot.lds: Discard .discard sections 2024-07-25 09:50:40 +02:00