Skip to content

Commit

Permalink
audit: explicitly check audit_context->context enum value
Browse files Browse the repository at this point in the history
[ Upstream commit 3ed6695 ]

Be explicit in checking the struct audit_context "context" member enum
value rather than assuming the order of context enum values.

Fixes: 12c5e81 ("audit: prepare audit_context for use in calling contexts beyond syscalls")
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rgbriggs authored and gregkh committed Oct 21, 2022
1 parent 9eb5fff commit b6bf224
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/auditsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2069,7 +2069,7 @@ void __audit_syscall_exit(int success, long 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)
if (context->current_state != AUDIT_STATE_RECORD)
goto out;

audit_log_exit();
Expand Down

0 comments on commit b6bf224

Please sign in to comment.