mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
audit: move audit_return_fixup before the filters
commitd4fefa4801
upstream. The success and return_code are needed by the filters. Move audit_return_fixup() before the filters. This was causing syscall auditing events to be missed. Link: https://github.com/linux-audit/audit-kernel/issues/138 Cc: stable@vger.kernel.org Fixes:12c5e81d3f
("audit: prepare audit_context for use in calling contexts beyond syscalls") Signed-off-by: Richard Guy Briggs <rgb@redhat.com> [PM: manual merge required] Signed-off-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9a6c710f3b
commit
22ebb780d5
1 changed files with 2 additions and 2 deletions
|
@ -1965,6 +1965,7 @@ void __audit_uring_exit(int success, long code)
|
|||
goto out;
|
||||
}
|
||||
|
||||
audit_return_fixup(ctx, success, code);
|
||||
if (ctx->context == AUDIT_CTX_SYSCALL) {
|
||||
/*
|
||||
* NOTE: See the note in __audit_uring_entry() about the case
|
||||
|
@ -2006,7 +2007,6 @@ void __audit_uring_exit(int success, long code)
|
|||
audit_filter_inodes(current, ctx);
|
||||
if (ctx->current_state != AUDIT_STATE_RECORD)
|
||||
goto out;
|
||||
audit_return_fixup(ctx, success, code);
|
||||
audit_log_exit();
|
||||
|
||||
out:
|
||||
|
@ -2090,13 +2090,13 @@ void __audit_syscall_exit(int success, long return_code)
|
|||
if (!list_empty(&context->killed_trees))
|
||||
audit_kill_trees(context);
|
||||
|
||||
audit_return_fixup(context, success, return_code);
|
||||
/* run through both filters to ensure we set the filterkey properly */
|
||||
audit_filter_syscall(current, context);
|
||||
audit_filter_inodes(current, context);
|
||||
if (context->current_state < AUDIT_STATE_RECORD)
|
||||
goto out;
|
||||
|
||||
audit_return_fixup(context, success, return_code);
|
||||
audit_log_exit();
|
||||
|
||||
out:
|
||||
|
|
Loading…
Reference in a new issue