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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z-qZ_4YmTJdFWAHF@shell.armlinux.org.uk>
Date: Mon, 31 Mar 2025 14:34:55 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: 谢致邦 (XIE Zhibang) <Yeking@...54.com>
Cc: ardb@...nel.org, bjorn.andersson@...yericsson.com, dave@...ilevsky.ca,
	ebiggers@...gle.com, linus.walleij@...aro.org,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	liuyuntao12@...wei.com, lumag@...nel.org, masahiroy@...nel.org,
	nathan@...nel.org, nico@...xnic.net, oskar.andero@...yericsson.com,
	ruanjinjie@...wei.com, victor.boivie@...yericsson.com,
	Max Uvarov <muvarov@...il.com>, Rob Herring <robh@...nel.org>
Subject: Re: Re: [PATCH] ARM: Fix support for CMDLINE_EXTEND

On Mon, Mar 31, 2025 at 01:55:23PM +0100, Russell King (Oracle) wrote:
> On Mon, Mar 31, 2025 at 08:29:21AM +0000, 谢致邦 (XIE Zhibang) wrote:
> > > Later arguments override earlier arguments. Any compiled-in command line
> > > needs to be overridable by user supplied input from the boot loader. The
> > > current behaviour is correct.
> > 
> > CMDLINE_EXTEND is for the built-in command line to "Extend bootloader kernel
> > arguments", not for the bootloader command line to extend/override built-in
> > command line.
> > 
> > Don't forget that the default empty CMDLINE already gives the bootloader the
> > ability to override everything. Not to mention that even if CMDLINE is not
> > empty, the default CMDLINE_FROM_BOOTLOADER continues to give the bootloader the
> > ability to override all.
> 
> The help text:
> 
> +         The command-line arguments provided by the boot loader will be
> +         appended to the default kernel command string.
> 
> so, you end up with default kernel command string _followed by_ the
> boot loader arguments. This allows the boot loader arguments to
> override anything that is in the default kernel command string.
> That's why it is a _default_ - it can be overrided.
> 
> If the boot loader command string is extended by the default kernel
> command string, then that doesn't happen.
> 
> CMDLINE_EXTEND is default _followed by_ boot loader.
> 
> You're wanting it to be the other way around. That's broken.

To add further weight:

ARM gained support for CMDLINE_EXTEND in commit 4394c1244249 ("ARM:
6893/1: Allow for kernel command line concatenation") dated 4 May
2011. In this commit, CONFIG_CMDLINE _prefixes_ the boot loader
supplied arguments.

In commit 34b82026a507 ("fdt: fix extend of cmd line") dated 13
April 2016, which _post_ _dates_ the introduction on ARM, and the
commit even states that it's fixing the lack of appending compared
to ARM, this adds code to drivers/of to _append_ CONFIG_CMDLINE
to the FDT arguments which come from the boot loader.

It is DT that implemented this wrongly.

No, we are not going to change arch/arm to conform to something
that was implemented in a broken way. drivers/of needs fixing
to actually implement it as it was *originally* intended - and
there is five years of arch/arm doing this *before* DT started
to do it.

If drivers/of maintainers also don't want to change, then I'm
sorry, but you have to then put up with the fact that it got
wrongly implemented by drivers/of and thus has a different
behaviour there.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ