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]
Date:   Tue, 4 May 2021 10:26:14 -0500
From:   Andrew Halaney <ahalaney@...hat.com>
To:     Borislav Petkov <bp@...e.de>
Cc:     Steven Rostedt <rostedt@...dmis.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] init: Print out unknown kernel parameters

On Tue, May 04, 2021 at 05:00:51PM +0200, Borislav Petkov wrote:
> 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.
> 
I tend to agree, while the "debug" option Randy mentioned gives you the
same info, I lean towards notifying about any unrecognized parameter
personally in an unconditional manner that is clearly mentioning your
command line arguments - it is a bit round about to have to find them
from init. Definitely a matter of opinion, but with the kernel having
specific ways to denote init destined parameters (anything after "--") I
think an unconditional message is acceptable.

> > > > +void print_unknown_bootoptions(void)
> 
> static
> 
Good catch, will fix this in v2 - thank you!

> > > > +{
> > > > +	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.
> 
I'm outvoted, will adjust to a single line!

> -- 
> Regards/Gruss,
>     Boris.
> 
> SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg
> 

Thanks,
Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ