Skip to content

Commit 35aa901

Browse files
eparisAl Viro
authored and
Al Viro
committed
Audit: fix audit watch use after free
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>
1 parent 4e8a237 commit 35aa901

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/auditfilter.c

+2
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,8 @@ static inline int audit_add_rule(struct audit_entry *entry)
13201320
mutex_unlock(&audit_filter_mutex);
13211321
goto error;
13221322
}
1323+
/* entry->rule.watch may have changed during audit_add_watch() */
1324+
watch = entry->rule.watch;
13231325
h = audit_hash_ino((u32)watch->ino);
13241326
list = &audit_inode_hash[h];
13251327
}

0 commit comments

Comments
 (0)