aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-09-12 22:54:17 -0400
committerJames Morris <jmorris@namei.org>2009-09-13 22:34:09 -0400
commit008574b11171a1ee9583a00188e27ff9e0432061 (patch)
treebada4ddf3c79a6a274a80839acd75eb132c78b29 /security/selinux
parented868a56988464cd31de0302426a5e94d3127f10 (diff)
SELinux: seperate avc_cache flushing
Move the avc_cache flushing into it's own function so it can be reused when disabling SELinux. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux')
-rw-r--r--security/selinux/avc.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index e3d19014259b..f60124623645 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -709,18 +709,16 @@ out:
709} 709}
710 710
711/** 711/**
712 * avc_ss_reset - Flush the cache and revalidate migrated permissions. 712 * avc_flush - Flush the cache
713 * @seqno: policy sequence number
714 */ 713 */
715int avc_ss_reset(u32 seqno) 714static void avc_flush(void)
716{ 715{
717 struct avc_callback_node *c;
718 int i, rc = 0, tmprc;
719 unsigned long flag;
720 struct avc_node *node;
721 struct hlist_head *head; 716 struct hlist_head *head;
722 struct hlist_node *next; 717 struct hlist_node *next;
718 struct avc_node *node;
723 spinlock_t *lock; 719 spinlock_t *lock;
720 unsigned long flag;
721 int i;
724 722
725 for (i = 0; i < AVC_CACHE_SLOTS; i++) { 723 for (i = 0; i < AVC_CACHE_SLOTS; i++) {
726 head = &avc_cache.slots[i]; 724 head = &avc_cache.slots[i];
@@ -737,6 +735,18 @@ int avc_ss_reset(u32 seqno)
737 rcu_read_unlock(); 735 rcu_read_unlock();
738 spin_unlock_irqrestore(lock, flag); 736 spin_unlock_irqrestore(lock, flag);
739 } 737 }
738}
739
740/**
741 * avc_ss_reset - Flush the cache and revalidate migrated permissions.
742 * @seqno: policy sequence number
743 */
744int avc_ss_reset(u32 seqno)
745{
746 struct avc_callback_node *c;
747 int rc = 0, tmprc;
748
749 avc_flush();
740 750
741 for (c = avc_callbacks; c; c = c->next) { 751 for (c = avc_callbacks; c; c = c->next) {
742 if (c->events & AVC_CALLBACK_RESET) { 752 if (c->events & AVC_CALLBACK_RESET) {