Skip to content

Commit 43471d1

Browse files
committed
audit_tree: Use mark flags to check whether mark is alive
Currently audit code uses checking of mark->inode to verify whether mark is still alive. Switch that to checking mark flags as that is more logical and current way will become unreliable in future. Reviewed-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent f410ff6 commit 43471d1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎kernel/audit_tree.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ static void insert_hash(struct audit_chunk *chunk)
190190
unsigned long key = chunk_to_key(chunk);
191191
struct list_head *list;
192192

193-
if (!key)
193+
if (!(chunk->mark.flags & FSNOTIFY_MARK_FLAG_ATTACHED))
194194
return;
195195
list = chunk_hash(key);
196196
list_add_rcu(&chunk->hash, list);
@@ -248,7 +248,7 @@ static void untag_chunk(struct node *p)
248248

249249
mutex_lock(&entry->group->mark_mutex);
250250
spin_lock(&entry->lock);
251-
if (chunk->dead || !entry->inode) {
251+
if (chunk->dead || !(entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
252252
spin_unlock(&entry->lock);
253253
mutex_unlock(&entry->group->mark_mutex);
254254
if (new)
@@ -408,7 +408,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
408408

409409
mutex_lock(&old_entry->group->mark_mutex);
410410
spin_lock(&old_entry->lock);
411-
if (!old_entry->inode) {
411+
if (!(old_entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
412412
/* old_entry is being shot, lets just lie */
413413
spin_unlock(&old_entry->lock);
414414
mutex_unlock(&old_entry->group->mark_mutex);

0 commit comments

Comments
 (0)