Skip to content

Commit

Permalink
SELinux: seperate avc_cache flushing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Paris authored and James Morris committed Sep 14, 2009
1 parent ed868a5 commit 008574b
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions security/selinux/avc.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,18 +709,16 @@ static int avc_update_node(u32 event, u32 perms, u32 ssid, u32 tsid, u16 tclass,
}

/**
* avc_ss_reset - Flush the cache and revalidate migrated permissions.
* @seqno: policy sequence number
* avc_flush - Flush the cache
*/
int avc_ss_reset(u32 seqno)
static void avc_flush(void)
{
struct avc_callback_node *c;
int i, rc = 0, tmprc;
unsigned long flag;
struct avc_node *node;
struct hlist_head *head;
struct hlist_node *next;
struct avc_node *node;
spinlock_t *lock;
unsigned long flag;
int i;

for (i = 0; i < AVC_CACHE_SLOTS; i++) {
head = &avc_cache.slots[i];
Expand All @@ -737,6 +735,18 @@ int avc_ss_reset(u32 seqno)
rcu_read_unlock();
spin_unlock_irqrestore(lock, flag);
}
}

/**
* avc_ss_reset - Flush the cache and revalidate migrated permissions.
* @seqno: policy sequence number
*/
int avc_ss_reset(u32 seqno)
{
struct avc_callback_node *c;
int rc = 0, tmprc;

avc_flush();

for (c = avc_callbacks; c; c = c->next) {
if (c->events & AVC_CALLBACK_RESET) {
Expand Down

0 comments on commit 008574b

Please sign in to comment.