All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SELinux: make inode_doinit_with_dentry printk debug
@ 2009-03-06 19:23 Eric Paris
  2009-03-08 21:48 ` James Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Paris @ 2009-03-06 19:23 UTC (permalink / raw)
  To: selinux; +Cc: sds, jmorris

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.

Signed-off-by: Eric Paris <eparis@redhat.com>
---

 security/selinux/hooks.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)


diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index c0eb2f4..ce6543a 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -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 majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [PATCH] SELinux: make inode_doinit_with_dentry printk debug
  2009-03-06 19:23 [PATCH] SELinux: make inode_doinit_with_dentry printk debug Eric Paris
@ 2009-03-08 21:48 ` James Morris
  0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2009-03-08 21:48 UTC (permalink / raw)
  To: Eric Paris; +Cc: selinux, sds

On Fri, 6 Mar 2009, Eric Paris wrote:

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

-- 
James Morris
<jmorris@namei.org>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

end of thread, other threads:[~2009-03-08 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-06 19:23 [PATCH] SELinux: make inode_doinit_with_dentry printk debug Eric Paris
2009-03-08 21:48 ` James Morris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.