lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_3E8155B4A33D48D6637F16CFE5ED293F0E08@qq.com>
Date: Fri, 28 Mar 2025 10:20:17 +0000
From: Yeking@...54.com
To: linux-arm-kernel@...ts.infradead.org
Cc: 谢致邦 (XIE Zhibang) <Yeking@...54.com>,
	Russell King <linux@...linux.org.uk>,
	"Russell King (Oracle)" <rmk+kernel@...linux.org.uk>,
	Linus Walleij <linus.walleij@...aro.org>,
	Ard Biesheuvel <ardb@...nel.org>,
	Eric Biggers <ebiggers@...gle.com>,
	Yuntao Liu <liuyuntao12@...wei.com>,
	Jinjie Ruan <ruanjinjie@...wei.com>,
	Dmitry Baryshkov <lumag@...nel.org>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Dave Vasilevsky <dave@...ilevsky.ca>,
	Nathan Chancellor <nathan@...nel.org>,
	Victor Boivie <victor.boivie@...yericsson.com>,
	Nicolas Pitre <nico@...xnic.net>,
	Oskar Andero <oskar.andero@...yericsson.com>,
	Bjorn Andersson <bjorn.andersson@...yericsson.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH] ARM: Fix support for CMDLINE_EXTEND

From: 谢致邦 (XIE Zhibang) <Yeking@...54.com>

It should be the default command line appended to the bootloader command
line, not the bootloader command line appended to the default command
line.

This will be consistent with the behavior of FDT, EFI, and other
platforms.

Fixes: 4394c1244249 ("ARM: 6893/1: Allow for kernel command line concatenation")
Signed-off-by: 谢致邦 (XIE Zhibang) <Yeking@...54.com>
---
 arch/arm/Kconfig              |  4 ++--
 arch/arm/kernel/atags_parse.c | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 25ed6f1a7c7a..635e4da33fff 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1534,8 +1534,8 @@ config CMDLINE_FROM_BOOTLOADER
 config CMDLINE_EXTEND
 	bool "Extend bootloader kernel arguments"
 	help
-	  The command-line arguments provided by the boot loader will be
-	  appended to the default kernel command string.
+	  The default kernel command string will be appended to the
+	  command-line arguments provided by the boot loader.
 
 config CMDLINE_FORCE
 	bool "Always use the default kernel command string"
diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c
index 4ec591bde3df..bd163f00602e 100644
--- a/arch/arm/kernel/atags_parse.c
+++ b/arch/arm/kernel/atags_parse.c
@@ -120,15 +120,15 @@ __tagtable(ATAG_REVISION, parse_tag_revision);
 
 static int __init parse_tag_cmdline(const struct tag *tag)
 {
-#if defined(CONFIG_CMDLINE_EXTEND)
-	strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
-	strlcat(default_command_line, tag->u.cmdline.cmdline,
-		COMMAND_LINE_SIZE);
-#elif defined(CONFIG_CMDLINE_FORCE)
+#if defined(CONFIG_CMDLINE_FORCE)
 	pr_warn("Ignoring tag cmdline (using the default kernel command line)\n");
 #else
 	strscpy(default_command_line, tag->u.cmdline.cmdline,
 		COMMAND_LINE_SIZE);
+#if defined(CONFIG_CMDLINE_EXTEND)
+	strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
+	strlcat(default_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
+#endif
 #endif
 	return 0;
 }
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ