linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* security_inode_init_security() inode field requirements
@ 2013-03-01 10:12 Steven Whitehouse
  2013-03-01 12:27 ` Mimi Zohar
  2013-03-03 19:12 ` Casey Schaufler
  0 siblings, 2 replies; 7+ messages in thread
From: Steven Whitehouse @ 2013-03-01 10:12 UTC (permalink / raw)
  To: Mimi Zohar, Chris Wright, linux-security-module, linux-fsdevel,
	cluster-devel, linux-kernel

Hi,

I'm wondering whether there is a list somewhere of fields which
security_inode_init_security() requires are set in an inode when it is
called? In particular, does it matter if the inode number itself is
unset when security_inode_init_security() is called?

The problem that I'm looking at is the use of multiple transactions
during inode creation when some combination of ACLs/LSMs/IMA are turned
on. What we have currently (in GFS2, there are other fs which follow
broadly the same solution though) is this:

1. Create inode in core
2. Create inode on disk
3. Add xattrs one at a time for ACLs/LSMs/IMA
4. Link inode into directory

Steps 2 through 4 require separate transactions at the moment. What I'd
like to do is to be able to get the details of the xattrs ahead of time
such that the allocation of the inode can be one and the same allocation
as that for the xattr blocks. That allows merging of the transactions
into one and a greatly simplified error path too. This would look
something like:

1. Create in-core inode and init required fields
2. Get details of all xattrs for the inode
3. Alloc on disk inode and blocks for xattrs as needed
4. Link into directory

In this case, steps 2 through 4 are within a single transaction. We
don't actually need to have the content of the xattrs ahead of
allocating the inode, just the length (or even just a max length, if it
is not too large). However the easiest solution would just be to move
the call to security_inode_init_security() to the point before we've
allocated the inode (and thus we don't know its number yet) but after
we've filled out all the remaining fields if that makes sense?

So I just wanted to check whether that would break anything,

Steve.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-03 19:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-01 10:12 security_inode_init_security() inode field requirements Steven Whitehouse
2013-03-01 12:27 ` Mimi Zohar
2013-03-01 13:11   ` Steven Whitehouse
2013-03-01 14:07     ` Mimi Zohar
2013-03-01 15:13       ` Eric Paris
2013-03-01 15:38         ` Steven Whitehouse
2013-03-03 19:12 ` Casey Schaufler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).