mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
fs/vfs/security: pass last path component to LSM on inode creation
SELinux would like to implement a new labeling behavior of newly created inodes. We currently label new inodes based on the parent and the creating process. This new behavior would also take into account the name of the new object when deciding the new label. This is not the (supposed) full path, just the last component of the path. This is very useful because creating /etc/shadow is different than creating /etc/passwd but the kernel hooks are unable to differentiate these operations. We currently require that userspace realize it is doing some difficult operation like that and than userspace jumps through SELinux hoops to get things set up correctly. This patch does not implement new behavior, that is obviously contained in a seperate SELinux patch, but it does pass the needed name down to the correct LSM hook. If no such name exists it is fine to pass NULL. Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
821404434f
commit
2a7dba391e
39 changed files with 136 additions and 94 deletions
|
@ -429,7 +429,8 @@ found:
|
|||
return group;
|
||||
}
|
||||
|
||||
struct inode *ext2_new_inode(struct inode *dir, int mode)
|
||||
struct inode *ext2_new_inode(struct inode *dir, int mode,
|
||||
const struct qstr *qstr)
|
||||
{
|
||||
struct super_block *sb;
|
||||
struct buffer_head *bitmap_bh = NULL;
|
||||
|
@ -585,7 +586,7 @@ got:
|
|||
if (err)
|
||||
goto fail_free_drop;
|
||||
|
||||
err = ext2_init_security(inode,dir);
|
||||
err = ext2_init_security(inode, dir, qstr);
|
||||
if (err)
|
||||
goto fail_free_drop;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue