]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - security/selinux/ss/policydb.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6-omap-h63xx.git] / security / selinux / ss / policydb.c
index ba48961f9d0593f99a30b0c3983a09c63425f766..f05f97a2bc3a1343e5960f1c409a8ae0e7e565f4 100644 (file)
@@ -21,6 +21,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/errno.h>
@@ -374,7 +375,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 +392,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
@@ -468,7 +469,7 @@ static int common_destroy(void *key, void *datum, void *p)
        return 0;
 }
 
-static int class_destroy(void *key, void *datum, void *p)
+static int cls_destroy(void *key, void *datum, void *p)
 {
        struct class_datum *cladatum;
        struct constraint_node *constraint, *ctemp;
@@ -566,7 +567,7 @@ static int cat_destroy(void *key, void *datum, void *p)
 static int (*destroy_f[SYM_NUM]) (void *key, void *datum, void *datap) =
 {
        common_destroy,
-       class_destroy,
+       cls_destroy,
        role_destroy,
        type_destroy,
        user_destroy,
@@ -598,6 +599,7 @@ void policydb_destroy(struct policydb *p)
        struct range_trans *rt, *lrt = NULL;
 
        for (i = 0; i < SYM_NUM; i++) {
+               cond_resched();
                hashtab_map(p->symtab[i].table, destroy_f[i], NULL);
                hashtab_destroy(p->symtab[i].table);
        }
@@ -612,6 +614,7 @@ void policydb_destroy(struct policydb *p)
        avtab_destroy(&p->te_avtab);
 
        for (i = 0; i < OCON_NUM; i++) {
+               cond_resched();
                c = p->ocontexts[i];
                while (c) {
                        ctmp = c;
@@ -623,6 +626,7 @@ void policydb_destroy(struct policydb *p)
 
        g = p->genfs;
        while (g) {
+               cond_resched();
                kfree(g->fstype);
                c = g->head;
                while (c) {
@@ -639,18 +643,21 @@ void policydb_destroy(struct policydb *p)
        cond_policydb_destroy(p);
 
        for (tr = p->role_tr; tr; tr = tr->next) {
+               cond_resched();
                kfree(ltr);
                ltr = tr;
        }
        kfree(ltr);
 
        for (ra = p->role_allow; ra; ra = ra -> next) {
+               cond_resched();
                kfree(lra);
                lra = ra;
        }
        kfree(lra);
 
        for (rt = p->range_tr; rt; rt = rt -> next) {
+               cond_resched();
                if (lrt) {
                        ebitmap_destroy(&lrt->target_range.level[0].cat);
                        ebitmap_destroy(&lrt->target_range.level[1].cat);
@@ -1124,7 +1131,7 @@ static int class_read(struct policydb *p, struct hashtab *h, void *fp)
 out:
        return rc;
 bad:
-       class_destroy(key, cladatum, NULL);
+       cls_destroy(key, cladatum, NULL);
        goto out;
 }