Merge tag 'selinux-pr-20170831' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / security / selinux / avc.c
index e60c79de13e1c74ea6129cfb5431d5d2415cdc2d..2380b8d72cecbfaaf7649b4224a4d8869dddf9a0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Implementation of the kernel access vector cache (AVC).
  *
- * Authors:  Stephen Smalley, <sds@epoch.ncsc.mil>
+ * Authors:  Stephen Smalley, <sds@tycho.nsa.gov>
  *          James Morris <jmorris@redhat.com>
  *
  * Update:   KaiGai, Kohei <kaigai@ak.jp.nec.com>
@@ -197,8 +197,6 @@ void __init avc_init(void)
        avc_xperms_data_cachep = kmem_cache_create("avc_xperms_data",
                                        sizeof(struct extended_perms_data),
                                        0, SLAB_PANIC, NULL);
-
-       audit_log(current->audit_context, GFP_KERNEL, AUDIT_KERNEL, "AVC INITIALIZED\n");
 }
 
 int avc_get_hash_stats(char *page)
@@ -348,27 +346,26 @@ static struct avc_xperms_decision_node
        struct avc_xperms_decision_node *xpd_node;
        struct extended_perms_decision *xpd;
 
-       xpd_node = kmem_cache_zalloc(avc_xperms_decision_cachep,
-                               GFP_ATOMIC | __GFP_NOMEMALLOC);
+       xpd_node = kmem_cache_zalloc(avc_xperms_decision_cachep, GFP_NOWAIT);
        if (!xpd_node)
                return NULL;
 
        xpd = &xpd_node->xpd;
        if (which & XPERMS_ALLOWED) {
                xpd->allowed = kmem_cache_zalloc(avc_xperms_data_cachep,
-                                               GFP_ATOMIC | __GFP_NOMEMALLOC);
+                                               GFP_NOWAIT);
                if (!xpd->allowed)
                        goto error;
        }
        if (which & XPERMS_AUDITALLOW) {
                xpd->auditallow = kmem_cache_zalloc(avc_xperms_data_cachep,
-                                               GFP_ATOMIC | __GFP_NOMEMALLOC);
+                                               GFP_NOWAIT);
                if (!xpd->auditallow)
                        goto error;
        }
        if (which & XPERMS_DONTAUDIT) {
                xpd->dontaudit = kmem_cache_zalloc(avc_xperms_data_cachep,
-                                               GFP_ATOMIC | __GFP_NOMEMALLOC);
+                                               GFP_NOWAIT);
                if (!xpd->dontaudit)
                        goto error;
        }
@@ -396,8 +393,7 @@ static struct avc_xperms_node *avc_xperms_alloc(void)
 {
        struct avc_xperms_node *xp_node;
 
-       xp_node = kmem_cache_zalloc(avc_xperms_cachep,
-                               GFP_ATOMIC|__GFP_NOMEMALLOC);
+       xp_node = kmem_cache_zalloc(avc_xperms_cachep, GFP_NOWAIT);
        if (!xp_node)
                return xp_node;
        INIT_LIST_HEAD(&xp_node->xpd_head);
@@ -550,7 +546,7 @@ static struct avc_node *avc_alloc_node(void)
 {
        struct avc_node *node;
 
-       node = kmem_cache_zalloc(avc_node_cachep, GFP_ATOMIC|__GFP_NOMEMALLOC);
+       node = kmem_cache_zalloc(avc_node_cachep, GFP_NOWAIT);
        if (!node)
                goto out;