[Ocfs2-devel] [PATCH 2/3] ocfs2: Add security xattr support in ocfs2

Mark Fasheh mfasheh at suse.com
Wed Sep 24 01:47:14 PDT 2008


On Wed, Sep 24, 2008 at 03:37:13PM +0800, Tiger Yang wrote:
> Hi,Mark,
> 
> Mark Fasheh wrote:
>  > Don't we need to add a call to 'security_inode_init_security()' when 
> creating a new
> >inode?
> In security_inode_init_security(), it will check IS_PRIVATE(inode), if 
> it is not a private inode, it will return.
> It seems we don't use S_PRIVATE in ocfs2, do we?

Are you sure? This is the code I have in my git tree:

int security_inode_init_security(struct inode *inode, struct inode *dir,
				  char **name, void **value, size_t *len)
{
	if (unlikely(IS_PRIVATE(inode)))
		return -EOPNOTSUPP;
	return security_ops->inode_init_security(inode, dir, name, value,
len);
}
EXPORT_SYMBOL(security_inode_init_security);


So the check is looking for S_PRIVATE and skipping only if it's set, which
would mean that this gets run for most inodes...


> anyway, I can add this call in ocfs2 quickly.

Yeah, I think we need it.

Thanks,
	--Mark

--
Mark Fasheh



More information about the Ocfs2-devel mailing list