Skip to content

Commit 2088d60

Browse files
committed
selinux: quiet the filesystem labeling behavior message
While the filesystem labeling method is only printed at the KERN_DEBUG level, this still appears in dmesg and on modern Linux distributions that create a lot of tmpfs mounts for session handling, the dmesg can easily be filled with a lot of "SELinux: initialized (dev X ..." messages. This patch removes this notification for the normal case but leaves the error message intact (displayed when mounting a filesystem with an unknown labeling behavior). Reported-by: Dave Jones <davej@codemonkey.org.uk> Signed-off-by: Paul Moore <pmoore@redhat.com>
1 parent e230f12 commit 2088d60

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

security/selinux/hooks.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,10 +456,6 @@ static int sb_finish_set_opts(struct super_block *sb)
456456
if (sbsec->behavior > ARRAY_SIZE(labeling_behaviors))
457457
printk(KERN_ERR "SELinux: initialized (dev %s, type %s), unknown behavior\n",
458458
sb->s_id, sb->s_type->name);
459-
else
460-
printk(KERN_DEBUG "SELinux: initialized (dev %s, type %s), %s\n",
461-
sb->s_id, sb->s_type->name,
462-
labeling_behaviors[sbsec->behavior-1]);
463459

464460
sbsec->flags |= SE_SBINITIALIZED;
465461
if (selinux_is_sblabel_mnt(sb))

0 commit comments

Comments
 (0)