summaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2022-08-25 15:32:38 -0400
committerPaul Moore <paul@paul-moore.com>2022-08-26 17:17:11 -0400
commit3ed66951f952ed8f1a5d03e171722bf2631e8d58 (patch)
treee80a33c9ef4b4c7823d92bfd85b1c298d0f0c1cd /kernel/auditsc.c
parente84d9f5214cb854fcd584aa78b5634794604d306 (diff)
downloadlinux-stable-3ed66951f952ed8f1a5d03e171722bf2631e8d58.tar.gz
linux-stable-3ed66951f952ed8f1a5d03e171722bf2631e8d58.tar.bz2
linux-stable-3ed66951f952ed8f1a5d03e171722bf2631e8d58.zip
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: 12c5e81d3fd0 ("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>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 21e50e6d0fc0..d77c9805c6b1 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -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);