Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755756Ab2JCSCM (ORCPT ); Wed, 3 Oct 2012 14:02:12 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:53795 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751630Ab2JCSCK (ORCPT ); Wed, 3 Oct 2012 14:02:10 -0400 Date: Wed, 3 Oct 2012 11:02:07 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Kees Cook cc: linux-kernel@vger.kernel.org, Andrew Morton , Minchan Kim , Joe Perches , Kautuk Consul , linux-mm@kvack.org, Brad Spengler Subject: Re: [PATCH] mm: use %pK for /proc/vmallocinfo In-Reply-To: Message-ID: References: <20121002234934.GA9194@www.outflux.net> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1257 Lines: 26 On Wed, 3 Oct 2012, Kees Cook wrote: > > So root does echo 0 > /proc/sys/kernel/kptr_restrict first. Again: what > > are you trying to protect? > > Only CAP_SYS_ADMIN can change the setting. This is, for example, for > containers, or other situations where a uid 0 process lacking > CAP_SYS_ADMIN cannot see virtual addresses. It's a very paranoid case, > yes, but it's part of how this feature was designed. Think of it as > supporting the recent uid 0 vs ring 0 boundary. :) > The intention of /proc/vmallocinfo being S_IRUSR is obviously to only allow root to read this information to begin with, so if root lacks CAP_SYS_ADMIN then it seems the best fix would be to return an empty file on read()? Or give permission to everybody to read it but only return a positive count when they have CAP_SYS_ADMIN? There's no need to make this so convoluted that you need to have the right combination of uid, kptr_restrict, CAP_SYS_ADMIN, and CAP_SYSLOG to get anything valuable out of this file, though. -- 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/