Lines Matching refs:avc

96 void selinux_avc_init(struct selinux_avc **avc)  in selinux_avc_init()  argument
107 *avc = &selinux_avc; in selinux_avc_init()
110 unsigned int avc_get_cache_threshold(struct selinux_avc *avc) in avc_get_cache_threshold() argument
112 return avc->avc_cache_threshold; in avc_get_cache_threshold()
115 void avc_set_cache_threshold(struct selinux_avc *avc, in avc_set_cache_threshold() argument
118 avc->avc_cache_threshold = cache_threshold; in avc_set_cache_threshold()
222 int avc_get_hash_stats(struct selinux_avc *avc, char *page) in avc_get_hash_stats() argument
233 head = &avc->avc_cache.slots[i]; in avc_get_hash_stats()
248 atomic_read(&avc->avc_cache.active_nodes), in avc_get_hash_stats()
510 static void avc_node_delete(struct selinux_avc *avc, struct avc_node *node) in avc_node_delete() argument
514 atomic_dec(&avc->avc_cache.active_nodes); in avc_node_delete()
517 static void avc_node_kill(struct selinux_avc *avc, struct avc_node *node) in avc_node_kill() argument
522 atomic_dec(&avc->avc_cache.active_nodes); in avc_node_kill()
525 static void avc_node_replace(struct selinux_avc *avc, in avc_node_replace() argument
530 atomic_dec(&avc->avc_cache.active_nodes); in avc_node_replace()
533 static inline int avc_reclaim_node(struct selinux_avc *avc) in avc_reclaim_node() argument
542 hvalue = atomic_inc_return(&avc->avc_cache.lru_hint) & in avc_reclaim_node()
544 head = &avc->avc_cache.slots[hvalue]; in avc_reclaim_node()
545 lock = &avc->avc_cache.slots_lock[hvalue]; in avc_reclaim_node()
552 avc_node_delete(avc, node); in avc_reclaim_node()
568 static struct avc_node *avc_alloc_node(struct selinux_avc *avc) in avc_alloc_node() argument
579 if (atomic_inc_return(&avc->avc_cache.active_nodes) > in avc_alloc_node()
580 avc->avc_cache_threshold) in avc_alloc_node()
581 avc_reclaim_node(avc); in avc_alloc_node()
595 static inline struct avc_node *avc_search_node(struct selinux_avc *avc, in avc_search_node() argument
603 head = &avc->avc_cache.slots[hvalue]; in avc_search_node()
628 static struct avc_node *avc_lookup(struct selinux_avc *avc, in avc_lookup() argument
634 node = avc_search_node(avc, ssid, tsid, tclass); in avc_lookup()
643 static int avc_latest_notif_update(struct selinux_avc *avc, in avc_latest_notif_update() argument
652 if (seqno < avc->avc_cache.latest_notif) { in avc_latest_notif_update()
654 seqno, avc->avc_cache.latest_notif); in avc_latest_notif_update()
658 if (seqno > avc->avc_cache.latest_notif) in avc_latest_notif_update()
659 avc->avc_cache.latest_notif = seqno; in avc_latest_notif_update()
684 static struct avc_node *avc_insert(struct selinux_avc *avc, in avc_insert() argument
693 if (avc_latest_notif_update(avc, avd->seqno, 1)) in avc_insert()
696 node = avc_alloc_node(avc); in avc_insert()
709 head = &avc->avc_cache.slots[hvalue]; in avc_insert()
710 lock = &avc->avc_cache.slots_lock[hvalue]; in avc_insert()
717 avc_node_replace(avc, node, pos); in avc_insert()
847 static int avc_update_node(struct selinux_avc *avc, in avc_update_node() argument
859 node = avc_alloc_node(avc); in avc_update_node()
868 head = &avc->avc_cache.slots[hvalue]; in avc_update_node()
869 lock = &avc->avc_cache.slots_lock[hvalue]; in avc_update_node()
885 avc_node_kill(avc, node); in avc_update_node()
929 avc_node_replace(avc, node, orig); in avc_update_node()
939 static void avc_flush(struct selinux_avc *avc) in avc_flush() argument
948 head = &avc->avc_cache.slots[i]; in avc_flush()
949 lock = &avc->avc_cache.slots_lock[i]; in avc_flush()
958 avc_node_delete(avc, node); in avc_flush()
968 int avc_ss_reset(struct selinux_avc *avc, u32 seqno) in avc_ss_reset() argument
973 avc_flush(avc); in avc_ss_reset()
985 avc_latest_notif_update(avc, seqno, 0); in avc_ss_reset()
1008 return avc_insert(state->avc, ssid, tsid, tclass, avd, xp_node); in avc_compute_av()
1024 avc_update_node(state->avc, AVC_CALLBACK_GRANT, requested, driver, in avc_denied()
1057 node = avc_lookup(state->avc, ssid, tsid, tclass); in avc_has_extended_perms()
1086 avc_update_node(state->avc, AVC_CALLBACK_ADD_XPERMS, requested, in avc_has_extended_perms()
1147 node = avc_lookup(state->avc, ssid, tsid, tclass); in avc_has_perm_noaudit()
1214 return state->avc->avc_cache.latest_notif; in avc_policy_seqno()
1231 avc_flush(selinux_state.avc); in avc_disable()