Skip to content

Commit

Permalink
[PATCH] audit: fix broken class-based syscall audit
Browse files Browse the repository at this point in the history
The sanity check in audit_match_class() is wrong.  We are able to audit
2048 syscalls but in audit_match_class() we were accidentally using
sizeof(_u32) instead of number of bits in _u32 when deciding how many
syscalls were valid.  On ia64 in particular we were hitting syscall
numbers over the (wrong) limit of 256.  Fixing the audit_match_class
check takes care of the problem.

Signed-off-by: Klaus Weidner <klaus@atsec.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Klaus Weidner authored and Al Viro committed Jul 22, 2007
1 parent 5b9a426 commit c926e4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/auditfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ int __init audit_register_class(int class, unsigned *list)

int audit_match_class(int class, unsigned syscall)
{
if (unlikely(syscall >= AUDIT_BITMASK_SIZE * sizeof(__u32)))
if (unlikely(syscall >= AUDIT_BITMASK_SIZE * 32))
return 0;
if (unlikely(class >= AUDIT_SYSCALL_CLASSES || !classes[class]))
return 0;
Expand Down

0 comments on commit c926e4f

Please sign in to comment.