From 278b2abf660a3e0991eb9f16f11bd9e9514a286d Mon Sep 17 00:00:00 2001 From: Avi Weiss Date: Tue, 27 Oct 2026 09:37:20 +0200 Subject: [PATCH] init/bootconfig: pass init arguments in documented order start_kernel() appends command-line init arguments before bootconfig init arguments, while setup_command_line() places them in the opposite order. As a result, the arguments passed to init do not match the saved command line, reversing the intended precedence of options. Parse extra_init_args before after_dashes so command-line init arguments are passed last. Link: https://lore.kernel.org/all/20261027073719.4010659-2-thnkslprpt@gmail.com/ Fixes: b66fbbe8d482 ("init/bootconfig: Reorder init parameter from bootconfig and cmdline") Signed-off-by: Avi Weiss Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) --- init/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init/main.c b/init/main.c index 31f2bf54976a..4efcb9956c39 100644 --- a/init/main.c +++ b/init/main.c @@ -1028,12 +1028,12 @@ void start_kernel(void) __stop___param - __start___param, -1, -1, NULL, &unknown_bootoption); print_unknown_bootoptions(); - if (!IS_ERR_OR_NULL(after_dashes)) - parse_args("Setting init args", after_dashes, NULL, 0, -1, -1, - NULL, set_init_arg); if (extra_init_args) parse_args("Setting extra init args", extra_init_args, NULL, 0, -1, -1, NULL, set_init_arg); + if (!IS_ERR_OR_NULL(after_dashes)) + parse_args("Setting init args", after_dashes, NULL, 0, -1, -1, + NULL, set_init_arg); /* Architectural and non-timekeeping rng init, before allocator init */ random_init_early(command_line);