Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp957732pxb; Wed, 3 Mar 2021 22:30:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGqTcF3BkKUygTL75A6kLsRBUAelQsPXKBt4wg+rKOQz8A1VoN77/LnJVsCv+K1B5eWoPw X-Received: by 2002:aa7:d0d7:: with SMTP id u23mr2607257edo.255.1614839425815; Wed, 03 Mar 2021 22:30:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839425; cv=none; d=google.com; s=arc-20160816; b=flgb3PO8v+zva78Vd7GYuQUPCzl2Kx5ZL3ZElmvJrUXiOKGskB+N2K3yKQO0z8K1WC ZOuGMDiD9GXm5VhPxr466SHSher+qOYiDebWbEzpKPZFBVakjTgE6JhkZ6Oldrv/u6FX UfhbtyItVuZdjjMDNF+XqcMvKRHX62SeMM1HviP5eV5lAQJc6+H+3SURr3MwuaIyTJNF xROQ5n1f41YmB1dCf3WEn+OvIiD9gF2nqdBajL2WDbbW/b/zn2Sd1R4hMC/3JuGXm2xq cEqfch/qiLMPSf9PF/8zrW5zn3Dm0xZQDDT9AbyOEpOgHThR44qm6JcvcHZEB+0Bk5YK xiJQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=goohwlevuJkiPEJ0sTSvtztSg0MP/O0Yn+wj3YqwVhU=; b=KsRNNPRAn6RnQh889StLIByjiU1U+/WxO1GUO7ZyQ9O+4T56Qa3eSTDT/8BeJGVt6J 9x61pk4zgLbcokCXtvxsH7uKM6beCcbXCqo20gldGfsGKkTiAwq6XaQX1RnebLwzjOWT s+HvLwMjsFpQFSGJOMAiWCvyg4ZTeP13wABIWF40hvSJUr3jnNSqVvEKNs+vCOLKC04E Tqc/Zc0Y7a2+hj+7/eEVcifDADpsVVddPefN8ufxn+ZA7uzK78U/XCMvziCO2DHwCbMb vNU53HnfQaPJBwDe2irCVoET66ak0sLpNZwMIVESOG4ojao+8sRT9mNqV2WL6wCgMHIh vVUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=NSV1CvnT; 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 lb6si16693706ejc.557.2021.03.03.22.30.02; Wed, 03 Mar 2021 22:30:25 -0800 (PST) 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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=NSV1CvnT; 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 S241542AbhCBRM7 (ORCPT + 99 others); Tue, 2 Mar 2021 12:12:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384493AbhCBPFT (ORCPT ); Tue, 2 Mar 2021 10:05:19 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE02C061756 for ; Tue, 2 Mar 2021 06:37:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=goohwlevuJkiPEJ0sTSvtztSg0MP/O0Yn+wj3YqwVhU=; b=NSV1CvnTBbHjdAdg7o0PaNVfFs tmNkXfLUYklr+6K915FB6jEhTnjHdm5MPLr2jmcYdW5xnvMfPnQvZ2iQQwLeNcuHrT2Onj+EFb2ef X59o9K5iFjZWb8Y1umOsXZ1adD6oQApO9uAlKJSee3WaHX51Gi4x0L44VJS3uk1amoWQFoKoc1LQO 61Avj2sqj7prZ7cWWOIUzVrriNb+wgAjPUQLWxJ8aSwgGAWW41dSgKvxDerVV5/S2FccBUixh/Ige 0lQ2XTIiv7w08MEdEebbIRMkX6NCGMba2AeP0zV/1rsnQmXhacDvfJK0LFGZpIHAWWcvxuih73PXc bWTT1oXQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lH67I-00HH07-Qw; Tue, 02 Mar 2021 14:35:23 +0000 Date: Tue, 2 Mar 2021 14:35:16 +0000 From: Matthew Wilcox To: Marco Elver Cc: Steven Rostedt , Geert Uytterhoeven , Vlastimil Babka , Petr Mladek , Timur Tabi , Sergey Senozhatsky , Andy Shevchenko , 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: <20210302143516.GY2723601@casper.infradead.org> 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 02, 2021 at 03:26:50PM +0100, Marco Elver wrote: > +static const char no_hash_pointers_warning[9][55] __initconst = { > + "******************************************************", > + " NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ", > + " ", > + " This system shows unhashed kernel memory addresses ", > + " via the console, logs, and other interfaces. This ", > + " might reduce the security of your system. ", > + " If you see this message and you are not debugging ", > + " the kernel, report this immediately to your system ", > + " administrator! ", > +}; > + > static int __init no_hash_pointers_enable(char *str) > { > + const int lines[] = { 0, 1, 2, 3, 4, 5, 2, 6, 7, 8, 2, 1, 0 }; > + int i; > + > 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"); > + for (i = 0; i < ARRAY_SIZE(lines); i++) > + pr_warn("**%s**\n", no_hash_pointers_warning[lines[i]]); + for (i = 0; i < 3; i++) + pr_warn("**%s**\n", no_hash_pointers_warning[lines[2 - i]]);