diff options
Diffstat (limited to 'security/selinux/avc.c')
| -rw-r--r-- | security/selinux/avc.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/security/selinux/avc.c b/security/selinux/avc.c index e3d19014259b..1ed0f076aadc 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 | */ |
| 715 | int avc_ss_reset(u32 seqno) | 714 | static 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 | */ | ||
| 744 | int 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) { |
| @@ -858,6 +868,8 @@ u32 avc_policy_seqno(void) | |||
| 858 | 868 | ||
| 859 | void avc_disable(void) | 869 | void avc_disable(void) |
| 860 | { | 870 | { |
| 871 | avc_flush(); | ||
| 872 | synchronize_rcu(); | ||
| 861 | if (avc_node_cachep) | 873 | if (avc_node_cachep) |
| 862 | kmem_cache_destroy(avc_node_cachep); | 874 | kmem_cache_destroy(avc_node_cachep); |
| 863 | } | 875 | } |
