X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=security%2Fselinux%2Favc.c;h=e4396a89edc620dfd8e52aafebe7273c30869c0a;hb=e6df3a663a5d1ee68aeae7f007197f272700d9cc;hp=e7c0b5e2066bbb532995ba0758516c236b60c1d1;hpb=0a01707b289853f56d1c000057b27e243c039722;p=linux-2.6-omap-h63xx.git diff --git a/security/selinux/avc.c b/security/selinux/avc.c index e7c0b5e2066..e4396a89edc 100644 --- a/security/selinux/avc.c +++ b/security/selinux/avc.c @@ -217,6 +217,8 @@ static void avc_dump_query(struct audit_buffer *ab, u32 ssid, u32 tsid, u16 tcla audit_log_format(ab, " tcontext=%s", scontext); kfree(scontext); } + + BUG_ON(tclass >= ARRAY_SIZE(class_to_string) || !class_to_string[tclass]); audit_log_format(ab, " tclass=%s", class_to_string[tclass]); } @@ -332,11 +334,10 @@ static struct avc_node *avc_alloc_node(void) { struct avc_node *node; - node = kmem_cache_alloc(avc_node_cachep, GFP_ATOMIC); + node = kmem_cache_zalloc(avc_node_cachep, GFP_ATOMIC); if (!node) goto out; - memset(node, 0, sizeof(*node)); INIT_RCU_HEAD(&node->rhead); INIT_LIST_HEAD(&node->list); atomic_set(&node->ae.used, 1);