From: Andrew Halaney <ahalaney@redhat.com>
To: Borislav Petkov <bp@suse.de>
Cc: Steven Rostedt <rostedt@goodmis.org>,
Randy Dunlap <rdunlap@infradead.org>,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] init: Print out unknown kernel parameters
Date: Wed, 5 May 2021 11:37:28 -0500 [thread overview]
Message-ID: <20210505163728.oh7rqpdvxrdilmfk@halaneylaptop> (raw)
In-Reply-To: <YJKpv6vjCcCkbzNT@zn.tnic>
On Wed, May 05, 2021 at 04:20:47PM +0200, Borislav Petkov wrote:
> On Tue, May 04, 2021 at 10:26:14AM -0500, Andrew Halaney wrote:
> > 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.
>
> Or - and I had alluded to that on IRC - you *actually* know which params
> are kernel params:
>
> #define __setup_param(str, unique_id, fn, early) \
> static const char __setup_str_##unique_id[] __initconst \
> __aligned(1) = str; \
> static struct obs_kernel_param __setup_##unique_id \
> __used __section(".init.setup") \
> ^^^^^^^^^^^^^^^^^^
>
> __aligned(__alignof__(struct obs_kernel_param)) \
> = { __setup_str_##unique_id, fn, early }
>
>
> all those guys in the above section.
I actually did use that recommendation essentially, the patch I've sent
is riding on the work done by unknown_bootoption() which is populated by
iterating over over the different sections parameters can live in - so
this is only printing out arguments that didn't match a known kernel
parameter. Sorry if I didn't make that clear earlier, definitely was
trying to listen to your advice.
>
> So you'd have iterate over those and do some cheap version of those
> autocorrect algorithms which guess which words you meant. For example,
> if you have:
>
> panik_on_oops instead of
> panic_on_oops
>
> the difference is one letter so it is likely a mistyped param rather
> than something which goes to init or other random garbage and then you
> warn.
>
> Something like that.
>
> It would need a lot of experimentation first, though, to see whether
> this makes sense and it is workable at all.
I'll have to think about this some more (the "did you mean this
parameter" part).. that seems like it might be more trouble than it is
worth, but I admittedly haven't looked into those cheap algorithms you
mentioned yet. The reason I say it might be more trouble than it is
worth is because it is easy to say "why didn't my param work", then grep
for it in dmesg and find it in the "Unknown command line parameters"
list - that's sort of the workflow I imagined would happen when someone
mucks with their kernel cli and doesn't get the intended result.
Thanks,
Andrew
next prev parent reply other threads:[~2021-05-05 16:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 21:34 Andrew Halaney
2021-05-03 21:59 ` Randy Dunlap
2021-05-03 22:46 ` Steven Rostedt
2021-05-04 15:00 ` Borislav Petkov
2021-05-04 15:26 ` Andrew Halaney
2021-05-05 14:20 ` Borislav Petkov
2021-05-05 16:37 ` Andrew Halaney [this message]
2021-05-05 16:50 ` Borislav Petkov
2021-05-05 16:55 ` Andrew Halaney
2021-05-05 17:08 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210505163728.oh7rqpdvxrdilmfk@halaneylaptop \
--to=ahalaney@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bp@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®