--- qin an <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I use the LSM in my jobs and need to store some
> private information of
> each file in disk, but I do not know how to do this.
> 
> It seems that the hook, inode_init_security,
> undertakes this job,
> which use the setxattr to store the private
> information in disk.
> However, when I used the hook and set the **name and
> **value (two
> parameters of hook), I didn't get the right
> information after I
> getxattr from my program.

inode_init_security is only one of the hooks
you need to be concerned with. d_instantiate
is another. There are several hooks with
"xattr" in their names, and depending on your
nefarious purposes you may need to address
them as well.

The SELinux code is currently your best example
of an LSM module that uses the interfaces.
SELinux uses the information in sophisticated
ways, so don't let the complexity of the code
scare you. It is possible to use more simply.



Casey Schaufler
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe 
linux-security-module" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to