Re: [PATCH] init/main.c: Wrap long kernel cmdline when printing to logs
From: Heiko Carstens
Date: Tue Oct 21 2025 - 09:17:39 EST
On Tue, Oct 21, 2025 at 09:05:48AM +0200, Geert Uytterhoeven wrote:
> On Mon, 20 Oct 2025 at 18:04, Doug Anderson <dianders@xxxxxxxxxxxx> wrote:
> > On Mon, Oct 20, 2025 at 8:42 AM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> > > On Mon, 20 Oct 2025 at 17:33, Doug Anderson <dianders@xxxxxxxxxxxx> wrote:
> > > > Printing the command line to the kernel log buffer is one of the very
> > > > rare cases where:
> > > > * There's a legitimate reason to print a (potentially) very long
> > > > string to the kernel buffer.
> > >
> > > arch/s390/Kconfig:
> > >
> > > config COMMAND_LINE_SIZE
> > > int "Maximum size of kernel command line"
> > > default 4096
> > > range 896 1048576
> > >
> > > Yummy...
> >
> > Wow, what are they expecting to stuff in there? An encoded initramfs
> > or something? I kinda feel like the 1MB number isn't something anyone
> > expects but is a number picked to effectively be "unlimited".
>
> Dunno, commit 622021cd6c560ce7 ("s390: make command line configurable")
> lacks the "why" part.
That was just a follow-on patch of commit 5ecb2da660ab ("s390: support command
lines longer than 896 bytes") which solved the real problem with a too short
maximum command line size back then. In order to never have to deal with this
sort of problem again it was made configurable.
But I doubt that anybody will change the default ever.