Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755531Ab2JCFPR (ORCPT ); Wed, 3 Oct 2012 01:15:17 -0400 Received: from mail-ia0-f174.google.com ([209.85.210.174]:34997 "EHLO mail-ia0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755329Ab2JCFPP (ORCPT ); Wed, 3 Oct 2012 01:15:15 -0400 MIME-Version: 1.0 In-Reply-To: References: <20121002234934.GA9194@www.outflux.net> Date: Tue, 2 Oct 2012 22:15:14 -0700 X-Google-Sender-Auth: KXI0sAAnyZcRY7wUYB8BKXHqRkk Message-ID: Subject: Re: [PATCH] mm: use %pK for /proc/vmallocinfo From: Kees Cook To: David Rientjes Cc: linux-kernel@vger.kernel.org, Andrew Morton , Minchan Kim , Joe Perches , Kautuk Consul , linux-mm@kvack.org, Brad Spengler Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1386 Lines: 37 On Tue, Oct 2, 2012 at 10:12 PM, David Rientjes wrote: > 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. -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/