summaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2018-02-15 03:47:44 +0100
committerPaul Moore <paul@paul-moore.com>2018-02-15 20:40:25 +0100
commit94d14e3e7b41d99f0d62a41fd856183057e1e474 (patch)
treecc840d6314d06ae38ca5dc049318d3c2986330da /kernel/auditsc.c
parentaudit: deprecate the AUDIT_FILTER_ENTRY filter (diff)
downloadlinux-94d14e3e7b41d99f0d62a41fd856183057e1e474.tar.xz
linux-94d14e3e7b41d99f0d62a41fd856183057e1e474.zip
audit: bail before bug check if audit disabled
If audit is disabled, who cares if there is a bug indicating syscall in process or names already recorded. Bail immediately on audit disabled. Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to '')
-rw-r--r--kernel/auditsc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index bc534bfb49a4..4e0a4ac803db 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1511,14 +1511,11 @@ void __audit_syscall_entry(int major, unsigned long a1, unsigned long a2,
struct audit_context *context = tsk->audit_context;
enum audit_state state;
- if (!context)
+ if (!audit_enabled || !context)
return;
BUG_ON(context->in_syscall || context->name_count);
- if (!audit_enabled)
- return;
-
state = context->state;
if (state == AUDIT_DISABLED)
return;