From: Eric Paris <eparis@redhat.com>
Date: Sun, 13 Sep 2009 02:54:23 +0000 (-0400)
Subject: SELinux: flush the avc before disabling SELinux
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4e6d0bffd3d72a32b620525c9007d2482c731775;p=linux.git

SELinux: flush the avc before disabling SELinux

Before SELinux is disabled at boot it can create AVC entries.  This patch
will flush those entries before disabling SELinux.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
---

diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index f601246236459..1ed0f076aadcf 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -868,6 +868,8 @@ u32 avc_policy_seqno(void)
 
 void avc_disable(void)
 {
+	avc_flush();
+	synchronize_rcu();
 	if (avc_node_cachep)
 		kmem_cache_destroy(avc_node_cachep);
 }