Skip to content

Commit

Permalink
Audit: fix audit watch use after free
Browse files Browse the repository at this point in the history
When an audit watch is added to a parent the temporary watch inside the
original krule from userspace is freed.  Yet the original watch is used after
the real watch was created in audit_add_rules()

Signed-off-by: Eric Paris <eparis@redhat.com>
  • Loading branch information
Eric Paris authored and Al Viro committed Jun 24, 2009
1 parent 4e8a237 commit 35aa901
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/auditfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,8 @@ static inline int audit_add_rule(struct audit_entry *entry)
mutex_unlock(&audit_filter_mutex);
goto error;
}
/* entry->rule.watch may have changed during audit_add_watch() */
watch = entry->rule.watch;
h = audit_hash_ino((u32)watch->ino);
list = &audit_inode_hash[h];
}
Expand Down

0 comments on commit 35aa901

Please sign in to comment.