public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* LSM hook addition?
@ 2005-01-24  5:58 John Richard Moser
  2005-01-24  6:28 ` Chris Wright
  2005-01-24  8:42 ` Valdis.Kletnieks
  0 siblings, 2 replies; 3+ messages in thread
From: John Richard Moser @ 2005-01-24  5:58 UTC (permalink / raw)
  To: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Can someone point me to documentation or give me a small patch to add an
LSM hook to kernel 2.6.10 in fs/namei.c at line 1986:

        new_dentry = lookup_create(&nd, 0);
        error = PTR_ERR(new_dentry);
        if (!IS_ERR(new_dentry)) {
                error = security_inode_make_hardlink(old_nd); // ADD
                error = vfs_link(old_nd.dentry, nd.dentry->d_inode,
new_dentry);

I believe this would be sufficient to finish an LSM module to implement
linking restrictions from GrSecurity.  I did Symlinks in an LSM module,
but haven't tested it out; it's purely academic.  I guess adding an LSM
hook would be an interesting academic experience; I'd enjoy examining a
patch that adds this hook, and then trying to add another hook myself.

The hook here would be used (in my academic exploration) to prevent hard
links from being created to files you don't own, unless you're root.

- --
All content of all messages exchanged herein are left in the
Public Domain, unless otherwise explicitly stated.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB9I5vhDd4aOud5P8RAmNNAJ44riGGJ6CP1sCC/CHfIJiD0u6augCeNFEI
PjjmHxipSD2wRyv4z+JElig=
=VDIo
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2005-01-24  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-24  5:58 LSM hook addition? John Richard Moser
2005-01-24  6:28 ` Chris Wright
2005-01-24  8:42 ` Valdis.Kletnieks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox