Received: by 10.223.176.46 with SMTP id f43csp1066821wra; Fri, 19 Jan 2018 06:28:40 -0800 (PST) X-Google-Smtp-Source: ACJfBotKnIt0QTirqqzZxLEbOMCldYU2s21G1P8eK014PkQID01tNwYhLoI2D1SCsfFVTxqJKtDI X-Received: by 10.101.72.143 with SMTP id n15mr25495555pgs.181.1516372120340; Fri, 19 Jan 2018 06:28:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516372120; cv=none; d=google.com; s=arc-20160816; b=vSPiBc2u4Zhqscq53dSzbwKVoo/zoY+QB+/7MCpuJD3xlGxb7ByOJk+rSmWoXBJ5uJ Jz2Ojm8E4kWtNIu3y9JbvkKpUBnXEB5SUgDttAweq6ApTAE9zvsRagJFxVbfXy6f/itW Kl5ujbl3AI/q3q4E9PV+88LjHJipWlzqy66x0Hyzs65gPFrUIt8PTDFb0ix/mM59jZJI tX5Oqm+EX3e29RpBTTnCoU50rsKOcxP+n2ORtLbYAChKG4MEKi4xpduqnPcGJAWN+mfM HY2aJPhm4uwvzQnjCozEHNI9+uA4dvgXNP5A6DcsOT9ogBVHkzo5K8RFa7XOfD8eoKxr 5+fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=spV4CuHMSF1gRaZrohj5QorcwxDTML8S0GqjujVSTIM=; b=TbbV/Ib54FlZ1hj4Kppon++BEUuYWa8OOWI2ZbpR+HdaWokbww18H61SKi7qYUU2k4 S0E3XEeiLWuFFJsjL97ehKvNf2BrRDNmpBOBDWoooRfYlWevo5Lf4Wp7jHayNHBb8Imd 19Ubk/RT8+HewXDTOXzZYTY20dcM/cLuCrE8ytF12BwC12O5SUxJD7zd2JZTmZ2rnV94 Zp+z1zYJG/ZVnN+uLHwEjNUtRob7ZLO3638UaYcbGwN7ViALlLF6mh7m48rBPRE4e2zY CxExeul9QkCrzkCmgOoRokDC0srnQPuLxB8ANo4Oo/xDaLyj81hlKreWvMqu+m470UG6 9C+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JXHUdetF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si8442825pgu.65.2018.01.19.06.28.25; Fri, 19 Jan 2018 06:28:40 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JXHUdetF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755881AbeASO1O (ORCPT + 99 others); Fri, 19 Jan 2018 09:27:14 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:41866 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755020AbeASO1G (ORCPT ); Fri, 19 Jan 2018 09:27:06 -0500 Received: by mail-lf0-f65.google.com with SMTP id f136so2307377lff.8 for ; Fri, 19 Jan 2018 06:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=spV4CuHMSF1gRaZrohj5QorcwxDTML8S0GqjujVSTIM=; b=JXHUdetFMoqvprPdxOcIjWUP75SlLV+DCAkixqIhW4o8JHqxT0jis/gMdfbDsrWbWe ygoroVY8W+YEXW02hh0g0YMPvL0HCA+cMtP5IbuzhE00Fg8lw9HlXSBayAOdKUD2MawS PYRfjgE5z/clO48t90lWtjkVWE9SICU1kkCFSQa+cNV+kPBHgrodiaDez0RbCinZK6PT CduwBMHH6RP+N2ylTHVVTnXS7WTmY73gXbjTfEd5ClL9XWIIWcUNLCxlwfaPl+tR70nh 8wfIzGze+U1MlTzbyLL7PhCpav+hTLGD/Ae7FJy13dhZBt/3HCc15IIEbqpMfhRWDVqv zz+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=spV4CuHMSF1gRaZrohj5QorcwxDTML8S0GqjujVSTIM=; b=LCul1JMCJMT5l35LBEHKkwyBZ4Are/iJmkAbT17FmuI6rj8RX7pugCa41tPr5lwdrW 3e4d+fKhAFkTDVHIrOvN3S4mr1xTrOwI07zjt4eXNisyyFylHt/CfSgmofIA4QvdDjls fxR3bmdVz5WvDvTSCnvBnM7Tw1MrVz6juwTOyQvim16Kk4pWfiCFUrW7xVHthDy1q23R IaI4wpWiX4jjf9/t/5lOuMj4nlQSKePx/zHe89gF5Hn54vcCrGm5bCHC7zgJArYyjYdH +RXBtOn8AfbSONbJzBj/Hnhwmc8KXckMdCadYl4WyeNJfa/0ovpqIPOTFWqnHYxOSljY BvfA== X-Gm-Message-State: AKwxytecemUMEndBCgB3rd9GXGbNSiYxcCcbWZIWYJC76Zmgcww0exJJ HpjRIrs4SxRtI1pNIdGJKP8= X-Received: by 10.46.126.5 with SMTP id z5mr711443ljc.84.1516372025223; Fri, 19 Jan 2018 06:27:05 -0800 (PST) Received: from mobilestation ([95.79.164.146]) by smtp.gmail.com with ESMTPSA id v17sm1738360ljv.38.2018.01.19.06.27.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jan 2018 06:27:04 -0800 (PST) Date: Fri, 19 Jan 2018 17:27:12 +0300 From: Serge Semin To: Matt Redfearn Cc: Florian Fainelli , ralf@linux-mips.org, miodrag.dinic@mips.com, jhogan@kernel.org, goran.ferenc@mips.com, david.daney@cavium.com, paul.gortmaker@windriver.com, paul.burton@mips.com, alex.belits@cavium.com, Steven.Hill@cavium.com, alexander.sverdlin@nokia.com, kumba@gentoo.org, marcin.nowakowski@mips.com, James.hogan@mips.com, Peter.Wotton@mips.com, Sergey.Semin@t-platforms.ru, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 11/14] MIPS: memblock: Print out kernel virtual mem layout Message-ID: <20180119142712.GA3101@mobilestation> References: <20180117222312.14763-1-fancer.lancer@gmail.com> <20180117222312.14763-12-fancer.lancer@gmail.com> <20180118201856.GA996@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 07:59:43AM +0000, Matt Redfearn wrote: Hello Matt, > 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 Ok. I'll hide the printouts behind both of that config macros in the next patchset version. Regards, -Sergey > > Thanks, > Matt > > > > >>-- > >>Florian