Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp502360pxy; Wed, 5 May 2021 07:21:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSPXreu5xVd0/fs1/nwI9d173BmMXBdAARenKptUM6wMJfFig47TvAVn7iz3Z13PShvsLo X-Received: by 2002:a65:4c0f:: with SMTP id u15mr10305489pgq.288.1620224517166; Wed, 05 May 2021 07:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620224517; cv=none; d=google.com; s=arc-20160816; b=ZeJ6TsTMkVvPVwJyHh8eE/j985nXFdAJ+RyVdHh+35fhAH4uwII4Y/zIuqHomYc1tH 3gp+4AcOzimEQEe1hWPRhxvvshWKeEhzfLJMMxVhzqoQARSeTrr2D87FB/KtMpmmC/yE qZZ+uLv3tK/ylnrL2Sd/nyaCR5HbF8+z7NOBlYT+P6oimeppJrQ+HIWp08+NL3k0Vh/3 36G8M9HdOScqZLRIsbfvn3lOhJkjSXBG4c9XdOWR/CJaRmFHHxkVAaDzC+RrJaLhDvbm suKl13RtvR5WFdF4JoO8v51INdD8eIh6oRDkyvCLHw9fsyzeKLibTgaan8z0mPMs2hA3 5H+Q== 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=xPI1LxaWJpByRV+GDO+WrpUqRBkgvv38MBbFh38arys=; b=kw+tThOyd9++QGnfdamg2ccYxoImPqDvbvV2i6Mw2dGjwkaP9hXNFSP/5mBE18pZfC 69z4Fsj+noJEmFdcwIaKkj01lJz4YrBxN9nkCNpC+OLOjaF7pyy5S8OMcFsaF+Ni54C4 IQ5O7Z1cOd4MbQP1jq9wJftrpH4P/OV3Aj/CFgatshTPxs9KNHTh8lBm6iiSUwV7Rpb9 AybOe53rdXR3oMEDq17mYCQ+SbMcd5Hd6xdCGuZwSN+aNcHIqzKwS0a/t2+8v3phTg6K OePDbXqvbUurMG3oxoODAvUdUu1DDGTQ4jz2jVNbe0Jq+fds1Rwz/xpwWmEJzvAy6oyb NJkQ== 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 c1si6259306pfv.158.2021.05.05.07.21.43; Wed, 05 May 2021 07:21:57 -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 S232383AbhEEOVv (ORCPT + 99 others); Wed, 5 May 2021 10:21:51 -0400 Received: from mx2.suse.de ([195.135.220.15]:46586 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232122AbhEEOVt (ORCPT ); Wed, 5 May 2021 10:21: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 2997AB209; Wed, 5 May 2021 14:20:52 +0000 (UTC) Date: Wed, 5 May 2021 16:20:47 +0200 From: Borislav Petkov To: Andrew Halaney Cc: Steven Rostedt , Randy Dunlap , 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> <20210504152614.mgiihv4ukqajo3jb@halaneylaptop> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210504152614.mgiihv4ukqajo3jb@halaneylaptop> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Thx. -- Regards/Gruss, Boris. SUSE Software Solutions Germany GmbH, GF: Felix Imendörffer, HRB 36809, AG Nürnberg