Re: [PATCH 03/11] VFS: Add security label support to *notify

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2008-02-28 at 16:39 -0500, Josef 'Jeff' Sipek wrote:
> On Thu, Feb 28, 2008 at 04:05:11PM -0500, Dave Quigley wrote:
> > 
> > On Thu, 2008-02-28 at 16:15 -0500, Josef 'Jeff' Sipek wrote:
> > > On Thu, Feb 28, 2008 at 03:39:30PM -0500, Dave Quigley wrote:
> > > ...
> > > > > Alright...so, few things...
> > > > > 
> > > > > 1) why do you need the locked/unlocked versions?
> > > > > 
> > > > > 2) instead of passing a flag to a common function, why not have:
> > > > > 
> > > > > vfs_setxattr_locked(....)
> > > > > {
> > > > > 	// original code minus the lock/unlock calls
> > > > > }
> > > > > 
> > > > > vfs_setxattr(....)
> > > > > {
> > > > > 	mutex_lock(...);
> > > > > 	vfs_setxattr_locked(...);
> > > > > 	mutex_unlock(...);
> > > > > }
> > > > 
> > > > What we do and what you propose aren't logically equivalent. There is a
> > > > permission check inside vfs_setxattr before the mutex lock.
> > > 
> > > Ah, right. I didn't notice the @@ line...
> > > 
> > > Josef 'Jeff' Sipek.
> > > 
> > 
> > I'm compiling a test kernel with your proposed change to make sure it
> > doesn't deadlock. If it works then I'll go with your solution since its
> > less messy.
> 
> I glanced at the call chain, and this one is making me uneasy:
> 
> vfs_setxattr => xattr_permission => permission => inode_op->permission
> 
> But Documentation/filesystems/Locking says that the inode permission op
> doesn't need an i_mutex, so things should be ok.
> 
> Josef 'Jeff' Sipek.
> 
Yea I saw the same thing. In practice it seems to be correct as well. I
looked at the ext2/3/4 and xfs implementations and they just call
generic_permission which doesn't grab i_mutex.

Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux