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] [day] [month] [year] [list]
Message-ID: <2d514d61-121d-44fc-aec7-637dd0920de8@infradead.org>
Date: Sun, 19 Oct 2025 15:22:59 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Douglas Anderson <dianders@...omium.org>, linux-kernel@...r.kernel.org
Cc: 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 10/19/25 10:06 AM, Douglas Anderson wrote:
> The kernel cmdline length is allowed to be longer than what printk can
> handle. When this happens the cmdline that's printed to the kernel
> ring buffer at bootup is cutoff and some kernel cmdline options are
> "hidden" from the logs. This undercuts the usefulness of the log
> message.
> 
> Add wrapping to the printout. Allow wrapping to be set lower by a
> Kconfig knob "CONFIG_CMDLINE_LOG_WRAP_IDEAL_LEN". By default, the
> wrapping is set to 1021 characters, which is measured to be the
> current maximum that pr_notice() can handle. Anyone whose cmdline
> isn't being cut off today should see no difference in log output.
> 
> Wrapping is based on spaces, ignoring quotes. All lines are prefixed
> with "Kernel command line: " and lines that are not the last line have
> a " \" suffix added to them. The prefix and suffix count towards the
> line length for wrapping purposes. The ideal length will be exceeded
> if no appropriate place to wrap is found.
> 
> Signed-off-by: Douglas Anderson <dianders@...omium.org>
> ---
> 
>  init/Kconfig | 10 +++++++
>  init/main.c  | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 92 insertions(+), 1 deletion(-)

Is this (length) only a problem for the kernel boot command line?

What does _printk() do with a very long string?

thanks.
-- 
~Randy


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ