new SE Linux and avc messages
It seems that the new SE Linux on 2.4.21 has less informative AVC messages from the kernel than old-style SE Linux. It seems that the name of the file that is related to the AVC message is almost never included in the message.
Steve, is there any chance of getting this changed? Doing a "find / -inum" to track down the file in question is rather time consuming with ~200,000 files in the file system (this is something I do all the time when writing policy).
Also for production environments, having several million files in a file system is quite common, in some cases running find on such a system is operationally impossible as it drags performance down so much that the server is effectively off-line for the duration (which may be a really long time).
Also with the kernel watchdog (which should be installed on all servers IMHO) and software RAID things get even more difficult as high disk latency can trigger a reboot.
My point is that even if there are reasons for not wanting to do this (such as performance) the issues with not doing it are considerable and will likely out-weigh them.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 13 lines · Russell Coker
It seems that the new SE Linux on 2.4.21 has less informative AVC messages from the kernel than old-style SE Linux. It seems that the name of the file that is related to the AVC message is almost never included in the message.
Steve, is there any chance of getting this changed? Doing a "find / -inum" to track down the file in question is rather time consuming with ~200,000 files in the file system (this is something I do all the time when writing policy).
Also for production environments, having several million files in a file system is quite common, in some cases running find on such a system is operationally impossible as it drags performance down so much that the server is effectively off-line for the duration (which may be a really long time).
Quoted 7 lines
Also with the kernel watchdog (which should be installed on all servers IMHO) and software RAID things get even more difficult as high disk latency can trigger a reboot.
My point is that even if there are reasons for not wanting to do this (such as performance) the issues with not doing it are considerable and will likely out-weigh them.
The auditing code will generate and include pathname information when it can be done reliably, i.e. when a (vfsmount, dentry) pair is available. Unfortunately, it is often the case that a pair is not available, and trying to generate a pathname from just a dentry or just an inode was considered a hack that had to be dropped as part of the code cleanup for mainline integration. If a dentry is available, we could include the d_name.name in the audit message (i.e. the last component of the pathname), but generating a full path isn't possible in any reliable manner.
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines · Stephen Smalley
The auditing code will generate and include pathname information when it can be done reliably, i.e. when a (vfsmount, dentry) pair is available. Unfortunately, it is often the case that a pair is not available, and trying to generate a pathname from just a dentry or just an inode was considered a hack that had to be dropped as part of the code cleanup for mainline integration. If a dentry is available, we could include the d_name.name in the audit message (i.e. the last component of the pathname), but generating a full path isn't possible in any reliable manner.
The patch below will include the component name from the dentry in the audit message when a vfsmount is not available. This might be acceptable in the mainline kernel. The patch does not attempt to traverse the parent links of the dentry to reconstruct a path up to the root of the mount, unlike the old avc_d_path code from the older SELinux; I doubt that would be acceptable in mainline.
Index: linux-2.6/security/selinux/avc.c
===================================================================
RCS file: /nfshome/pal/CVS/linux-2.6/security/selinux/avc.c,v retrieving revision 1.34
security/selinux/avc.c +11 -2
@@ -575,17 +575,26 @@break ;case AVC_AUDIT_DATA_FS :if (a->u.fs.dentry) { +struct dentry *dentry = a->u.fs.dentry;if (a->u.fs.mnt) { - p =d_path (a->u.fs.dentry, + p =d_path (dentry, a->u.fs.mnt, avc_audit_buffer,PAGE_SIZE );if (p)printk (" path=%s" , p); + }else { +printk (" name=%s" , dentry->d_name.name); } - inode = a->u.fs.dentry->d_inode; + inode = dentry->d_inode; }else if (a->u.fs.inode) { +struct dentry *dentry; inode = a->u.fs.inode; + dentry =d_find_alias (inode); +if (dentry) { +printk (" name=%s" , dentry->d_name.name); +dput (dentry); + } }if (inode) printk(" dev=%s ino=%ld",
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.