From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx131.postini.com [74.125.245.131]) by kanga.kvack.org (Postfix) with SMTP id 197E86B006E for ; Wed, 3 Oct 2012 01:37:48 -0400 (EDT) Received: by padfa10 with SMTP id fa10so6960830pad.14 for ; Tue, 02 Oct 2012 22:37:47 -0700 (PDT) Date: Tue, 2 Oct 2012 22:37:45 -0700 (PDT) From: David Rientjes Subject: Re: [PATCH] mm: use %pK for /proc/vmallocinfo In-Reply-To: Message-ID: References: <20121002234934.GA9194@www.outflux.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Kees Cook Cc: linux-kernel@vger.kernel.org, Andrew Morton , Minchan Kim , Joe Perches , Kautuk Consul , linux-mm@kvack.org, Brad Spengler On Tue, 2 Oct 2012, Kees Cook wrote: > >> In the paranoid case of sysctl kernel.kptr_restrict=2, mask the kernel > >> virtual addresses in /proc/vmallocinfo too. > >> > >> Reported-by: Brad Spengler > >> Signed-off-by: Kees Cook > > > > /proc/vmallocinfo is S_IRUSR, not S_IRUGO, so exactly what are you trying > > to protect? > > Trying to block the root user from seeing virtual memory addresses > (mode 2 of kptr_restrict). > > Documentation/sysctl/kernel.txt: > "This toggle indicates whether restrictions are placed on > exposing kernel addresses via /proc and other interfaces. When > kptr_restrict is set to (0), there are no restrictions. When > kptr_restrict is set to (1), the default, kernel pointers > printed using the %pK format specifier will be replaced with 0's > unless the user has CAP_SYSLOG. When kptr_restrict is set to > (2), kernel pointers printed using %pK will be replaced with 0's > regardless of privileges." > > Even though it's S_IRUSR, it still needs %pK for the paranoid case. > So root does echo 0 > /proc/sys/kernel/kptr_restrict first. Again: what are you trying to protect? -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org