[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=WeXOj_hyA=V9hMLHOJ_m9ui5mP6cRv2DpjXnR62_nd2w@mail.gmail.com>
Date: Mon, 20 Oct 2025 08:57:05 -0700
From: Doug Anderson <dianders@...omium.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Randy Dunlap <rdunlap@...radead.org>, linux-kernel@...r.kernel.org,
Andrew Chant <achant@...gle.com>, Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>, Brian Gerst <brgerst@...il.com>,
Christian Brauner <brauner@...nel.org>, Francesco Valla <francesco@...la.it>,
Geert Uytterhoeven <geert+renesas@...der.be>, Guo Weikang <guoweikang.kernel@...il.com>,
Huacai Chen <chenhuacai@...nel.org>, Jan Hendrik Farr <kernel@...rr.cc>, Jeff Xu <jeffxu@...omium.org>,
Kees Cook <kees@...nel.org>, Masahiro Yamada <masahiroy@...nel.org>,
Michal Koutný <mkoutny@...e.com>,
Miguel Ojeda <ojeda@...nel.org>, "Mike Rapoport (Microsoft)" <rppt@...nel.org>,
Nathan Chancellor <nathan@...nel.org>, Peter Zijlstra <peterz@...radead.org>,
Shakeel Butt <shakeel.butt@...ux.dev>, Tejun Heo <tj@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
"Uladzislau Rezki (Sony)" <urezki@...il.com>
Subject: Re: [PATCH] init/main.c: Wrap long kernel cmdline when printing to logs
Hi,
On Mon, Oct 20, 2025 at 8:42 AM Geert Uytterhoeven <geert@...ux-m68k.org> wrote:
>
> Hi Doug,
>
> On Mon, 20 Oct 2025 at 17:33, Doug Anderson <dianders@...omium.org> 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".
Do you have a suggestion of what my code should do if it sees such a
long cmdline? At small numbers (4K, 8K, maybe even 32K) printing the
wrapped cmdline is nice. Above that, maybe it should just print
something like "<cmdline truncated>" or something?
-Doug
Maybe after 32K or something the code should just give up?
Powered by blists - more mailing lists