Skip to contentSkip to conversation

SELinux: make inode_doinit_with_dentry printk debug

PATCH In review Eric Paris 2 participants 2 messages Mar 6, 2009 – Mar 8, 2009 SELinux security module

lore
Share & tools
lore

Eric Paris

author
#0 lore raw

PATCH 1/1 SELinux: make inode_doinit_with_dentry printk debug

Drop the printk level to debug when an inode is found without an associated dentry. This should only happen when userspace can't be accessing the inode and the label will get set correctly on the next inode_doinit before it can be used, so there is little reason to send this message.

---

 security/selinux/hooks.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
security/selinux/hooks.c +8 -1
index c0eb2f4..ce6543a 100644
@@ -1278,7 +1278,14 @@ static int inode_doinit_with_dentry(struct inode *inode, struct dentry *opt_dent
 			dentry = d_find_alias(inode);
 		}
 		if (!dentry) {
-			printk(KERN_WARNING "SELinux: %s:  no dentry for dev=%s "
+			/* this is easy to hit on boot when a file is accessed
+			 * before the policy is loaded.  When we load policy we
+			 * may find inodes that have no dentry as we walk the
+			 * sbsec->isec_head list.  No reason to complain as these
+			 * as they will get fixed up the next time we go through
+			 * inode_doinit with a dentry.
+			 */
+			printk(KERN_DEBUG "SELinux: %s:  no dentry for dev=%s "
 			       "ino=%ld\n", __func__, inode->i_sb->s_id,
 			       inode->i_ino);
 			goto out_unlock;

--
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.

#1 lore raw
Quoted 4 lines · Eric Paris

Drop the printk level to debug when an inode is found without an associated dentry. This should only happen when userspace can't be accessing the inode and the label will get set correctly on the next inode_doinit before it can be used, so there is little reason to send this message.

I'd prefer to have the message removed (but leave a comment in the code).

Signature · 7 lines
James Morris
<[email protected]>

--
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.