[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJFho3AasxxcD/hH@zn.tnic>
Date: Tue, 4 May 2021 17:00:51 +0200
From: Borislav Petkov <bp@...e.de>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Randy Dunlap <rdunlap@...radead.org>,
Andrew Halaney <ahalaney@...hat.com>,
akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] init: Print out unknown kernel parameters
On Mon, May 03, 2021 at 06:46:06PM -0400, Steven Rostedt wrote:
> Note, the issue this is trying to solve is to catch "typos" when someone
> adds a parameter. Perhaps we should add a parameter called "check" and/or a
> config option to always check.
Well, actually, you want this checking to always happen and
unconditionally at that.
The fact that we cannot differentiate between params given to init vs
mistyped params, makes it harder to solve elegantly.
> > > +void print_unknown_bootoptions(void)
static
> > > +{
> > > + const char *const *p;
> > > +
> > > + if (panic_later || (!argv_init[1] && !envp_init[2]))
> > > + return;
> > > +
> > > + pr_notice("Unknown command line parameters:\n");
> > > + for (p = &argv_init[1]; *p; p++)
> > > + pr_notice(" %s\n", *p);
> > > + for (p = &envp_init[2]; *p; p++)
> > > + pr_notice(" %s\n", *p);
> > > +}
>
> Perhaps make this one line, like "Kernel command line:" has.
Yap, only one newline at the end pls.
--
Regards/Gruss,
Boris.
SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
Powered by blists - more mailing lists