directory write denied messages
Could the kernel message log messages for denied write access to a directory be changed to give the path of the file that the process is attempting to create or rename? It would make it much easier to determine what was attempted...
Signature · 3 lines
I do not get viruses because I do not use MS software. If you use Outlook then please do not put my email address in your address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line
From field.
--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Russell Coker
Could the kernel message log messages for denied write access to a directory be changed to give the path of the file that the process is attempting to create or rename?
This information isn't available in the relevant hook function or its immediate caller from the kernel. Looking at lsm-2.4/fs/namei.c, you'll see that vfs_create() calls may_create() with both the directory and the child dentry, but may_create() calls permission() with just the directory. permission() then calls the inode_permission() hook [selinux_inode_permission when using SELinux]. This is what performs the write permission check.
Now, it is true that vfs_create() subsequently calls the inode_create() hook with both the directory and the child dentry [selinux_inode_create when using SELinux]. SELinux uses this hook to perform the finer-grained checks of add_name permission to the directory, create permission to the new file, and associate permission between the file and the filesystem. For these permission checks, the child dentry is used for auditing.
To provide what you want, we would have to disable directory write checking in selinux_inode_permission, deferring it to the appropriate finer-grained hook where we know the child dentry. If we were certain that every directory modification is and always will be covered by a finer-grained LSM hook, then this would be reasonable. However, I'm hesitant to make such an assumption. Notice that this issue is discussed in the module technical report as one of the changes from the original SELinux kernel patch.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.