Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3785328pxy; Tue, 4 May 2021 09:49:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3t0Srf+EPRkn8Wp/8wuy7fCYEdndsD0BbDfofxYaOHVJftEr7B/mXYtqdG30LcJCZHK7w X-Received: by 2002:a50:c44f:: with SMTP id w15mr27263790edf.79.1620146995505; Tue, 04 May 2021 09:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620146995; cv=none; d=google.com; s=arc-20160816; b=mBrXmZHF2FUYZSLrzhMOjyTepbdGaBJL24HRukdS7003vBhYzamCdAPkkl3ibBb797 QHw1c/0alYGhWyGUVZ2cViBCIkUmO0TX30FPEJ0UczcBtKqSHc8idn3lbEpJ1lxwogD8 9O2IBLv1T6BjLSeY8/qdAnA3SQ8r2fC+PlwY7ObZLUM5xEZ+g/9I5sFhd3Hc6YowEBJL BF9lGvE2aJoICf4bwH9q+nAfRDM4YzLYThgDGyrozC5xOjHNsIFHodguXrdN72+DyqQK 3s1JjU/IdDb1dQD8bvT+C94n4PuUtGp8DtRJbtt+MOlasHJzdGlz7DyqKNIf6knRxzmj O8wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zAml4WgcvBsIDzinbA/ZC4LZcXcs1WN3LtssBlL9/SU=; b=PxKn4on0I345iZqgJIYVJ6hYtYL66Fp9BHs7OArp4+6mmNOVredPfhAz2WjqYWzDUv 7Y9cRxfevCZKhyoienyFThJ9oTkOR2A6yIsLzv1HjSQe5HiWWXZ7KJl3uD6ObYyy8kml IuLUrmbqED7LN17dpBSsPGFyWb56MtDlz0EOGSjNwaHY0BLtBkbhj2a8gChokWOeZL88 kjb2XofAQwaplsVtuScd3jUF2sLMJwkDaSI6o6vSssniVeHQNxWqKvW0EFyoExeo83JX GpQtfSJp0a/yc9NjS78ZFJCh3dGXLFtlCjAhYhDBMAFsyhhXhZ23fwzFBM+lyeSO11xh EqSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f5si2295982edm.105.2021.05.04.09.49.27; Tue, 04 May 2021 09:49:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231610AbhEDPBu (ORCPT + 99 others); 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