Re: inode_post_removexattr() ?

From: Tony Jones (tonyj@private)
Date: Tue Nov 22 2005 - 12:10:37 PST


On Tue, Nov 22, 2005 at 06:47:50PM +0800, Hawk Xu wrote:
> Hi!
> 
> After removing the xattr of an inode by system call removexattr(),  how 
> do I update the i_security field of the inode? (e.g. release the space 
> and set it to NULL.)  Is there a inode_post_removexattr() hook or 
> something like that?
> 
> Thanks!

I can only suggest reading include/linux/security.h.

Assign module specific data to i_security in your 'inode_alloc_security' hook.
Release it in your 'inode_free_security' hook.

Most of the security labels on kernel objects have distinct alloc/free
hooks for a reason. In the freeing case the kernel usually calls the hook
when usage falls to zero and the kernel object is about to be released.  
Attempting to zero *_security outside of this situation is asking for problems 
unless you absolutely know what you're doing (locking wise) and even then I 
wouldn't recommend it.

Tony



This archive was generated by hypermail 2.1.3 : Tue Nov 22 2005 - 12:17:40 PST