From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242AbdCAPTB (ORCPT ); Wed, 1 Mar 2017 10:19:01 -0500 Received: from mail-qk0-f173.google.com ([209.85.220.173]:35244 "EHLO mail-qk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752132AbdCAPSz (ORCPT ); Wed, 1 Mar 2017 10:18:55 -0500 Subject: Re: [PATCH] arm64: dump: hide kernel pointers To: Will Deacon References: <1488265536-20441-1-git-send-email-miles.chen@mediatek.com> <20170228100420.GA3691@leverpostej> <20170301035214.GA12637@arm.com> Cc: Mark Rutland , Ard Biesheuvel , Miles Chen , Catalin Marinas , linux-mediatek@lists.infradead.org, "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , wsd_upstream@mediatek.com From: Laura Abbott Message-ID: Date: Wed, 1 Mar 2017 07:18:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170301035214.GA12637@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/28/2017 07:52 PM, Will Deacon wrote: > On Tue, Feb 28, 2017 at 02:55:51PM -0800, Laura Abbott wrote: >> On 02/28/2017 02:04 AM, Mark Rutland wrote: >>> On Tue, Feb 28, 2017 at 08:42:51AM +0000, Ard Biesheuvel wrote: >>>> On 28 February 2017 at 07:05, Miles Chen wrote: >>>>> Mask kernel pointers of /sys/kernel/debug/kernel_page_tables entry like >>>>> /proc/vmallocinfo does. >>>>> >>>>> With sysctl kernel.kptr_restrict=0 or 1: >>>>> cat /sys/kernel/debug/kernel_page_tables >>>> >>>> I wonder if this file should be accessible at all if kptr_restrict > 0 >>> >>> I don't have strong feelings either way. >>> >>> This isn't typically enabled, and it's under debugfs, so this shouldn't >>> be accessible by a typical user anyhow. >>> >>> That said, there are very few of us who need to take a look at this >>> file. I'm happy to deal with attacking kptr_restrict when required. >>> >> >> In the interest of security it's probably for the best to switch to the >> restricted pointer. Who knows what might get enabled or forgotten about. >> I don't like the idea of tying enablement of the file to kptr_restrict >> though. > > ... but it's also pretty weird to show the sizes, mapping type and > permissions yet hide the virtual addresses. If you want to keep the file > in spite of kptr_restrict, which bits are actually useful once the > addresses are nobbled? > > Will > I'm not saying the file is really useful, I just don't think kptr_restrict is the right mechanism for this. The current documented purpose is for printk formatting only and trying to double use that seems likely to confuse people if others start following the pattern elsewhere in the kernel. A separate knob might be cleaner. Thanks, Laura