Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp269251pxf; Wed, 31 Mar 2021 03:01:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZP3QoX/5au/8drrR0gom55MR6lWPu1kVwnoi4/bnD180ylISlUL9SFcSqTJqv1gLlA/Ji X-Received: by 2002:aa7:d484:: with SMTP id b4mr2675975edr.63.1617184877741; Wed, 31 Mar 2021 03:01:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617184877; cv=none; d=google.com; s=arc-20160816; b=bdy2JupxOaHVYTzdaB57lDvfnbg9HALh3p4QzM1Pamu0tlE3ACEreAHG+2sh6pj9e+ ZKsYdGY/lPzpJGhE4JTysvpJYH002JosjJhMmjyXP54Y3ihvbOSVXLjBdpfHkDftNMku g25dUhjNbpNhaa2hoisMmCrb7Sez4MLs8tA0I3HBxq7K385jdfPSdgVsV81IDRGTJuai yNIj58zLySbpyeoa10UJZd55HyZi+1vs6XyabJUxsN7V6Iyo0yYH0f2IdK9rh3qD06dT w17lER25SiZOWF1OXen2Oj6Q2O67Hsyl/G3+Q+vsaK3oXi6JW6CVKjFtkly82yk1XDVK YibQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5dlcbQ1uILmGlCjMuHUMG9KYXntoQFQ/aRe1xwtBfFg=; b=wuziPeu4QF/1M8jL3dkyLFRta1hTFE0FOLptVk6BadjzFYUaSBFXuCZqhWQQl+0Oep mwsxZDFvFAX3JoB5H92tlt0LktQF5mtOWVndafLOgE5Ofb4j01smY5v4qTlUCWjh6zzx hqJhg3I0sXXsngGjmqxOWYCY7I7d5ARQqabXQErZDSSkQRU/HG7WeuO1zVNxIpSriTu0 WUbJPre69QQ0IwQttMFPS0BZxleqB/vz539+NW04OspMThvuyPXJjPzezemsZKDcmVWK XqvLxG1HyGJwb5xIP8su4XwDSwPVEx2aQ8DFHymAkkxF9sIPZ+s7wCxwXp+g1STAfQOQ yWMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-embedded-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-embedded-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 q17si1309097ejj.672.2021.03.31.03.00.54; Wed, 31 Mar 2021 03:01:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-embedded-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-embedded-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-embedded-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235011AbhCaKAV (ORCPT + 89 others); Wed, 31 Mar 2021 06:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234957AbhCaJ7t (ORCPT ); Wed, 31 Mar 2021 05:59:49 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5555CC06174A for ; Wed, 31 Mar 2021 02:59:48 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:ada2:b4da:6568:5ad5]) by baptiste.telenet-ops.be with bizsmtp id mxzd240015W9KJv01xzdKe; Wed, 31 Mar 2021 11:59:48 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lRXdQ-00BseR-73; Wed, 31 Mar 2021 11:59:36 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1lRXBt-001bpo-DX; Wed, 31 Mar 2021 11:31:09 +0200 From: Geert Uytterhoeven To: Joerg Roedel , Will Deacon , Steven Rostedt , Ingo Molnar , Petr Mladek , Sergey Senozhatsky Cc: Linus Torvalds , Andrew Morton , Andy Shevchenko , Rasmus Villemoes , John Ogness , Gary R Hook , Marco Elver , Randy Dunlap , Vlastimil Babka , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 3/3] lib/vsprintf: Use pr_crit() instead of long fancy messages Date: Wed, 31 Mar 2021 11:31:04 +0200 Message-Id: <20210331093104.383705-4-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210331093104.383705-1-geert+renesas@glider.be> References: <20210331093104.383705-1-geert+renesas@glider.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-embedded@vger.kernel.org While long fancy messages have a higher probability of being seen than small messages, they may scroll of the screen fast, if visible at all, and may still be missed. In addition, they increase boot time and kernel size. The correct mechanism to increase importance of a kernel message is not to draw fancy boxes with more text, but to shout louder, i.e. increase the message's reporting level. Making sure the administrator of the system is aware of such a message is a system policy, and is the responsability of a user-space log daemon. Fix this by increasing the reporting level from KERN_WARNING to KERN_CRIT, and removing irrelevant text and graphics. This reduces kernel size by ca. 0.5 KiB. Fixes: 5ead723a20e0447b ("lib/vsprintf: no_hash_pointers prints all addresses as unhashed") Signed-off-by: Geert Uytterhoeven --- lib/vsprintf.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 9b423359bb6433d3..0293f1b89064b287 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -2193,20 +2193,9 @@ static int __init no_hash_pointers_enable(char *str) no_hash_pointers = true; - 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"); - 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"); - + pr_crit("This system shows unhashed kernel memory addresses\n"); + pr_crit("via the console, logs, and other interfaces. This\n"); + pr_crit("might reduce the security of your system.\n"); return 0; } early_param("no_hash_pointers", no_hash_pointers_enable); -- 2.25.1