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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 90EA6C4361A for ; Tue, 2 Mar 2021 19:46:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 621CE64F2C for ; Tue, 2 Mar 2021 19:46:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580835AbhCBSVo (ORCPT ); Tue, 2 Mar 2021 13:21:44 -0500 Received: from mga06.intel.com ([134.134.136.31]:34803 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1447268AbhCBPdS (ORCPT ); Tue, 2 Mar 2021 10:33:18 -0500 IronPort-SDR: yBONr8JFZIXgcK14onfp8saPU445QnqpqtNWtxA/2+JXLk0XoOyFct/se3gXfJRHEHrPdEIEc/ J7TtOXIjZRRA== X-IronPort-AV: E=McAfee;i="6000,8403,9911"; a="248258123" X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="248258123" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2021 07:29:58 -0800 IronPort-SDR: 15rbFgAnk1wAoW7qk1qh3Hjl7Tu8j51q4BNQ81ulINlDE+FX3Och0OoDdI2Pe48lHAUUROIIQu U2P/3RJuIUYQ== X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="368995015" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2021 07:29:52 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lH6y4-009Pvb-Jh; Tue, 02 Mar 2021 17:29:48 +0200 Date: Tue, 2 Mar 2021 17:29:48 +0200 From: Andy Shevchenko To: Geert Uytterhoeven Cc: Steven Rostedt , Vlastimil Babka , Petr Mladek , Marco Elver , Timur Tabi , Sergey Senozhatsky , Matthew Wilcox , Andrew Morton , Linus Torvalds , roman.fietze@magna.com, Kees Cook , John Ogness , Akinobu Mita , Alexander Potapenko , Andrey Konovalov , Rasmus Villemoes , Pavel Machek , Tetsuo Handa , Linux Kernel Mailing List , Linux MM Subject: Re: [PATCH 3/3] [v4] lib/vsprintf: no_hash_pointers prints all addresses as unhashed Message-ID: References: <20210214161348.369023-1-timur@kernel.org> <20210214161348.369023-4-timur@kernel.org> <8893ff08-1e50-316c-f632-cd37be1690d5@suse.cz> <20210302090811.620ae7d0@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 02, 2021 at 03:28:09PM +0100, Geert Uytterhoeven wrote: > On Tue, Mar 2, 2021 at 3:08 PM Steven Rostedt wrote: > > On Tue, 2 Mar 2021 14:49:42 +0100 > > Geert Uytterhoeven wrote: > > > > So this is basically a kernel tinyfication issue, right? Is that still pursued > > > > today? Are there better config options suitable for this than CONFIG_DEBUG_KERNEL? > > > > > > As long as I hear about products running Linux on SoCs with 10 MiB of > > > SRAM, I think the answer is yes. > > > I'm not immediately aware of a better config option. There are no more > > > TINY options left, and EXPERT selects DEBUG_KERNEL. > > > > Since the trace_printk() uses the same type of notice, I wonder if we could > > make this into a helper function and just pass in the top part. > > > > + pr_warn("**********************************************************\n"); > > + pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); > > + pr_warn("** **\n"); > > > > > > + pr_warn("** This system shows unhashed kernel memory addresses **\n"); > > + pr_warn("** via the console, logs, and other interfaces. This **\n"); > > + pr_warn("** might reduce the security of your system. **\n"); > > > > Only the above section is really unique. The rest can be a boiler plate. > > Good idea. drivers/iommu/iommu-debugfs.c has a third copy. +1. Let's keep it in some helper that can be added if we have a corresponding functionality. > > + pr_warn("** **\n"); > > + pr_warn("** If you see this message and you are not debugging **\n"); > > + pr_warn("** the kernel, report this immediately to your system **\n"); > > + pr_warn("** administrator! **\n"); > > + pr_warn("** **\n"); > > + pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); > > + pr_warn("**********************************************************\n"); > > Fortunately gcc is already smart enough to deduplicate identical strings, > but only in the same source file. -- With Best Regards, Andy Shevchenko