aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorThomas Liu <tliu@redhat.com>2009-06-24 17:58:05 -0400
committerJames Morris <jmorris@namei.org>2009-06-24 18:29:16 -0400
commit89c86576ecde504da1eeb4f4882b2189ac2f9c4a (patch)
tree94674a48becd9cfde298e9fe6b58db8da28fe238 /security/selinux/hooks.c
parenta893a84e8799270fbec5c3708d001650aab47138 (diff)
selinux: clean up avc node cache when disabling selinux
Added a call to free the avc_node_cache when inside selinux_disable because it should not waste resources allocated during avc_init if SELinux is disabled and the cache will never be used. Signed-off-by: Thomas Liu <tliu@redhat.com> Acked-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index e3b4f3083dd7..2081055f6783 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -5683,6 +5683,9 @@ int selinux_disable(void)
5683 selinux_disabled = 1; 5683 selinux_disabled = 1;
5684 selinux_enabled = 0; 5684 selinux_enabled = 0;
5685 5685
5686 /* Try to destroy the avc node cache */
5687 avc_disable();
5688
5686 /* Reset security_ops to the secondary module, dummy or capability. */ 5689 /* Reset security_ops to the secondary module, dummy or capability. */
5687 security_ops = secondary_ops; 5690 security_ops = secondary_ops;
5688 5691