Commit 3ed66951 authored by Richard Guy Briggs's avatar Richard Guy Briggs Committed by Paul Moore
Browse files

audit: explicitly check audit_context->context enum value



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

Fixes: 12c5e81d ("audit: prepare audit_context for use in calling contexts beyond syscalls")
Signed-off-by: default avatarRichard Guy Briggs <rgb@redhat.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent e84d9f52
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2068,7 +2068,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_return_fixup(context, success, return_code);