Reassign printk levels in selinux kernel code
Below is a patch which demotes many printk lines to KERN_DEBUG from KERN_INFO. It should help stop the spamming of logs with messages in which users are not interested nor is there any action that users should take. It also promotes some KERN_INFO to KERN_ERR such as when there are improper attempts to register/unregister security modules. A similar patch was discussed a while back on list: http://marc.theaimsgroup.com/?t=116656343500003&r=1&w=2 This patch addresses almost all of the issues raised. I believe the only advice not taken was in the demoting of messages related to undefined permissions and classes. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> security/selinux/hooks.c | 20 ++++++++++---------- security/selinux/ss/avtab.c | 2 +- security/selinux/ss/policydb.c | 6 +++--- security/selinux/ss/sidtab.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
@ -277,7 +277,7 @@ void avtab_hash_eval(struct avtab *h, char *tag)
|
||||
}
|
||||
}
|
||||
|
||||
printk(KERN_INFO "%s: %d entries and %d/%d buckets used, longest "
|
||||
printk(KERN_DEBUG "%s: %d entries and %d/%d buckets used, longest "
|
||||
"chain length %d\n", tag, h->nel, slots_used, AVTAB_SIZE,
|
||||
max_chain_len);
|
||||
}
|
||||
|
@ -374,7 +374,7 @@ static void symtab_hash_eval(struct symtab *s)
|
||||
struct hashtab_info info;
|
||||
|
||||
hashtab_stat(h, &info);
|
||||
printk(KERN_INFO "%s: %d entries and %d/%d buckets used, "
|
||||
printk(KERN_DEBUG "%s: %d entries and %d/%d buckets used, "
|
||||
"longest chain length %d\n", symtab_name[i], h->nel,
|
||||
info.slots_used, h->size, info.max_chain_len);
|
||||
}
|
||||
@ -391,14 +391,14 @@ static int policydb_index_others(struct policydb *p)
|
||||
{
|
||||
int i, rc = 0;
|
||||
|
||||
printk(KERN_INFO "security: %d users, %d roles, %d types, %d bools",
|
||||
printk(KERN_DEBUG "security: %d users, %d roles, %d types, %d bools",
|
||||
p->p_users.nprim, p->p_roles.nprim, p->p_types.nprim, p->p_bools.nprim);
|
||||
if (selinux_mls_enabled)
|
||||
printk(", %d sens, %d cats", p->p_levels.nprim,
|
||||
p->p_cats.nprim);
|
||||
printk("\n");
|
||||
|
||||
printk(KERN_INFO "security: %d classes, %d rules\n",
|
||||
printk(KERN_DEBUG "security: %d classes, %d rules\n",
|
||||
p->p_classes.nprim, p->te_avtab.nel);
|
||||
|
||||
#ifdef DEBUG_HASHES
|
||||
|
@ -253,7 +253,7 @@ void sidtab_hash_eval(struct sidtab *h, char *tag)
|
||||
}
|
||||
}
|
||||
|
||||
printk(KERN_INFO "%s: %d entries and %d/%d buckets used, longest "
|
||||
printk(KERN_DEBUG "%s: %d entries and %d/%d buckets used, longest "
|
||||
"chain length %d\n", tag, h->nel, slots_used, SIDTAB_SIZE,
|
||||
max_chain_len);
|
||||
}
|
||||
|
Reference in New Issue
Block a user