From: Chris Wright Subject: Re: changing permission()/vfs_permission... to work on dentry Date: Wed, 28 May 2003 21:38:09 -0700 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030528213809.A6734@figure1.int.wirex.com> References: <20030529005549.GJ14138@parcelfarce.linux.theplanet.co.uk> <1054182023.10017.53.camel@zaphod> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: viro@parcelfarce.linux.theplanet.co.uk, linux-fsdevel@vger.kernel.org Return-path: Received: from cerebus.wirex.com ([65.102.14.138]:8957 "EHLO figure1.int.wirex.com") by vger.kernel.org with ESMTP id S261863AbTE2E1d (ORCPT ); Thu, 29 May 2003 00:27:33 -0400 To: Shaya Potter Content-Disposition: inline In-Reply-To: <1054182023.10017.53.camel@zaphod>; from spotter@cs.columbia.edu on Thu, May 29, 2003 at 12:20:23AM -0400 List-Id: linux-fsdevel.vger.kernel.org * Shaya Potter (spotter@cs.columbia.edu) wrote: > On Wed, 2003-05-28 at 20:55, viro@parcelfarce.linux.theplanet.co.uk > wrote: > > So give it a _REAL_ namespace. And bind /dev/null over /bin/sh in it. > > And revoke the capability to call mount(2) and umount(2). End of story. > > The issue w/ the fs namespaces the kernel supports (at least AFAI > understand them) is that you can't change the underlying permission > model. yes, you are still stuck with inode mode bits and DAC. you can improve this with some MAC element, like using LSM, but this will not override the existing DAC decision, only further restrict it. and you need to either label the inode with an extended attribute or try and deal with pathnames as you've already mentioned. > so for example, an "apache namespace" you might want it to only have > read only access to everything besides a few files in /var/log. Can one > do that w/ namespaces? true. per-mountpoint read-only would allow you to create a namespace to do this. however, this gets back to changing permission() to taking vfsmount (or likely just nameidata) so that the IS_RDONLY() check could see mountpoint specific flags as well as the super_block flags. as i'm sure you've found, this changes a lot of code ;-) cheers, -chris -- Linux Security Modules http://lsm.immunix.org http://lsm.bkbits.net