From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11D35C433ED for ; Tue, 4 May 2021 15:00:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5A8B610A0 for ; Tue, 4 May 2021 15:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231663AbhEDPBu (ORCPT ); Tue, 4 May 2021 11:01:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:41704 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230301AbhEDPBt (ORCPT ); Tue, 4 May 2021 11:01:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1F506B200; Tue, 4 May 2021 15:00:54 +0000 (UTC) Date: Tue, 4 May 2021 17:00:51 +0200 From: Borislav Petkov To: Steven Rostedt Cc: Randy Dunlap , Andrew Halaney , akpm@linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] init: Print out unknown kernel parameters Message-ID: References: <20210503213400.27360-1-ahalaney@redhat.com> <20210503184606.5e8461c0@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210503184606.5e8461c0@gandalf.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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