From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756901Ab1INPs4 (ORCPT ); Wed, 14 Sep 2011 11:48:56 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:56413 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755292Ab1INPs4 (ORCPT ); Wed, 14 Sep 2011 11:48:56 -0400 Date: Wed, 14 Sep 2011 19:48:26 +0400 From: Vasiliy Kulikov To: kernel-hardening@lists.openwall.com, Dave Hansen Cc: Andrew Morton , Cyrill Gorcunov , Al Viro , Christoph Lameter , Pekka Enberg , Matt Mackall , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Dan Rosenberg , Theodore Tso , Alan Cox , Jesper Juhl , Linus Torvalds Subject: Re: [kernel-hardening] Re: [RFC PATCH 2/2] mm: restrict access to /proc/slabinfo Message-ID: <20110914154826.GA9942@albatros> References: <20110910164001.GA2342@albatros> <20110910164134.GA2442@albatros> <20110914131630.GA7001@albatros> <1316013505.4478.50.camel@nimitz> <20110914154229.GA9776@albatros> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110914154229.GA9776@albatros> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (cc'ed Dave back, sorry for the noise) On Wed, Sep 14, 2011 at 19:42 +0400, Vasiliy Kulikov wrote: > Hi Dave, > > On Wed, Sep 14, 2011 at 08:18 -0700, Dave Hansen wrote: > > On Wed, 2011-09-14 at 17:16 +0400, Vasiliy Kulikov wrote: > > > > World readable slabinfo simplifies kernel developers' job of debugging > > > > kernel bugs (e.g. memleaks), but I believe it does more harm than > > > > benefits. For most users 0444 slabinfo is an unreasonable attack vector. > > > > > > Please tell if anybody has complains about the restriction - whether it > > > forces someone besides kernel developers to do "chmod/chgrp". But if > > > someone want to debug the kernel, it shouldn't significantly influence > > > on common users, especially it shouldn't create security issues. > > > > Ubuntu ships today with a /etc/init/mounted-proc.conf that does: > > > > chmod 0400 "${MOUNTPOINT}"/slabinfo > > > > After cursing Kees's name a few times, I commented it out and it hasn't > > bothered me again. > > Another way is chgrp slabinfo to some "admin" group which are privileged > in this sense and add your user to this group. But please, sane and > secure defaults! > > > I expect that the folks that really care about this (and their distros) > > will probably have a similar mechanism. I guess the sword cuts both > > ways in this case: it obviously _works_ to have the distros do it, but > > it was a one-time inconvenience for me to override that. > > > > In other words, I dunno. If we do this in the kernel, can we at least > > do something like CONFIG_INSECURE to both track these kinds of things > > and make it easy to get them out of a developer's way? > > What do you think about adding your user to the slabinfo's group or > chmod it - quite the opposite Ubuntu currently does? I think it is more > generic (e.g. you may chmod 0444 to allow all users to get debug > information or just 0440 and chgrp admin to allow only trusted users to > do it) and your local policy doesn't touch the kernel. > > Thanks, > > -- > Vasiliy Kulikov > http://www.openwall.com - bringing security into open computing environments