[GIT PULL] bootconfig: Fixes for v7.4-rc1
From: Masami Hiramatsu (Google)
Date: Sat Oct 31 2026 - 20:00:27 EST
Linus,
Bootconfig fixes for v7.4-rc1:
- init/bootconfig: Pass init arguments in documented order
Parse extra_init_args before command-line init arguments in
start_kernel(). This ensures command-line options take precedence over
bootconfig, matching the documented order and saved command line.
Please pull the latest bootconfig-fixes-v7.4-rc1 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
bootconfig-fixes-v7.4-rc1
Tag SHA1: 3f9fe3c18f3bbbbf8b7ef9111d133051f9d7d890
Head SHA1: 278b2abf660a3e0991eb9f16f11bd9e9514a286d
Avi Weiss (1):
init/bootconfig: pass init arguments in documented order
----
init/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---------------------------
commit 278b2abf660a3e0991eb9f16f11bd9e9514a286d
Author: Avi Weiss <thnkslprpt@xxxxxxxxx>
Date: Tue Oct 27 09:37:20 2026 +0200
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@xxxxxxxxx/
Fixes: b66fbbe8d482 ("init/bootconfig: Reorder init parameter from bootconfig and cmdline")
Signed-off-by: Avi Weiss <thnkslprpt@xxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>
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);
--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>