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>
This commit is contained in:
@@ -970,3 +970,9 @@ u32 avc_policy_seqno(void)
|
||||
{
|
||||
return avc_cache.latest_notif;
|
||||
}
|
||||
|
||||
void avc_disable(void)
|
||||
{
|
||||
if (avc_node_cachep)
|
||||
kmem_cache_destroy(avc_node_cachep);
|
||||
}
|
||||
|
Reference in New Issue
Block a user