Received: by 10.223.176.46 with SMTP id f43csp675935wra; Fri, 19 Jan 2018 00:04:26 -0800 (PST) X-Google-Smtp-Source: ACJfBouC+AAoNZvNggydaHK7uW3F+IiVWLUN0/tvBbCauKlQqANozHytklkxZzubQPu/a4KiV3d1 X-Received: by 10.98.159.139 with SMTP id v11mr9023860pfk.64.1516349066012; Fri, 19 Jan 2018 00:04:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516349065; cv=none; d=google.com; s=arc-20160816; b=WqF1IVS9bTPaa6renTCebuSmzjTfw+0ovVgtX2R871l8rdGt4qNnVRAVv7QlPrOSSg xBJo+yAM6jrO0FqLKgblAUEFs07SDobKGKV5FlPTTtb6J8725dTw6E8zwi8HE81s6mwt wzrlg4vZKlXVC9zOlUAarLHoOvxe/Pingkx6G1XMuus/f/dPcbOn1B/8QYELlFL/TapO FEPGuksnC+V3Vsh01OnfMHkIHq2nM5S3w8xkP7YZceT0zCMGhLSDhWKPzxhWG/XON84W n0V7KAk49UNE+6436lAKiC1qXE8HWPcQWB9VlD7lEBz1QlIlcNyx3zlu1xEJwf6PFtrz yusg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=njzHJsylRc7eGfernUKZQliYQR5qzMinxbnVb9VSPlc=; b=foRdMMWE4xlKpnKDcl0AmgwtyEzOlOEh/SMq/dU3FXuZF8O9zSmlyopNKgPefvRWpj JTMq/BHggnE0JaZggtniD6eF/RyH+q1cCUaQyxyLmayAc8KrNuThsDpE36TfTALe/+RW EfLXfh3HIlSQVM57NxBCwMiwaUUgsTVDfod7A88eIs4kIX3hlmTi6XisvDYj7h9B96y0 0pJQe7gO9RO5D1FCJehVp7Pe0Yvu0RMIpDx/SVoXVQSBOg+QXUjIIwRnNeCRsM1NJ13m l3N5SvnXL3sXijssrIpB1COd6kPr+RQdPZkSLhiHSSSW2WwRL3iqEBwNn5WQ0r9c1pPO 7kuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62-v6si637034ple.267.2018.01.19.00.04.11; Fri, 19 Jan 2018 00:04:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754232AbeASICc (ORCPT + 99 others); Fri, 19 Jan 2018 03:02:32 -0500 Received: from 9pmail.ess.barracuda.com ([64.235.150.225]:47030 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbeASIC1 (ORCPT ); Fri, 19 Jan 2018 03:02:27 -0500 Received: from MIPSMAIL01.mipstec.com (mailrelay.mips.com [12.201.5.28]) by mx3.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NO); Fri, 19 Jan 2018 08:00:41 +0000 Received: from [10.150.130.83] (10.150.130.83) by MIPSMAIL01.mipstec.com (10.20.43.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 18 Jan 2018 23:59:48 -0800 Subject: Re: [PATCH 11/14] MIPS: memblock: Print out kernel virtual mem layout To: Serge Semin , Florian Fainelli CC: , , , , , , , , , , , , , , , , References: <20180117222312.14763-1-fancer.lancer@gmail.com> <20180117222312.14763-12-fancer.lancer@gmail.com> <20180118201856.GA996@mobilestation> From: Matt Redfearn Message-ID: Date: Fri, 19 Jan 2018 07:59:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180118201856.GA996@mobilestation> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.150.130.83] X-BESS-ID: 1516348840-298554-31495-40455-1 X-BESS-VER: 2017.17-r1801171719 X-BESS-Apparent-Source-IP: 12.201.5.28 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.189139 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Serge, On 18/01/18 20:18, Serge Semin wrote: > On Thu, Jan 18, 2018 at 12:03:03PM -0800, Florian Fainelli wrote: >> On 01/17/2018 02:23 PM, Serge Semin wrote: >>> It is useful to have the kernel virtual memory layout printed >>> at boot time so to have the full information about the booted >>> kernel. In some cases it might be unsafe to have virtual >>> addresses freely visible in logs, so the %pK format is used if >>> one want to hide them. >>> >>> Signed-off-by: Serge Semin >> >> I personally like having that information because that helps debug and >> have a quick reference, but there appears to be a trend to remove this >> in the name of security: >> >> https://patchwork.kernel.org/patch/10124007/ >> >> maybe hide this behind a configuration option? > > Yeah, arm code was the place I picked the function up.) But in my case > I've used %pK so the pointers would disappear from logging when > kptr_restrict sysctl is 1 or 2. > I agree, that we might need to make the printouts optional. If there is > any kernel config, which for instance increases the kernel security we > could also use it or anything else to discard the printouts at compile > time. Certainly, when KASLR is active it would be preferable to hide this information, so you could use CONFIG_RELOCATABLE. The existing KASLR stuff additionally hides this kind of information behind CONFIG_DEBUG_KERNEL, so that only people actively debugging the kernel see it: http://elixir.free-electrons.com/linux/v4.15-rc8/source/arch/mips/kernel/setup.c#L604 Thanks, Matt > >> -- >> Florian