aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/auditsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r--kernel/auditsc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 3ea836d3d941..9618d1507251 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -177,6 +177,7 @@ struct audit_aux_data_path {
177 177
178/* The per-task audit context. */ 178/* The per-task audit context. */
179struct audit_context { 179struct audit_context {
180 int dummy; /* must be the first element */
180 int in_syscall; /* 1 if task is in a syscall */ 181 int in_syscall; /* 1 if task is in a syscall */
181 enum audit_state state; 182 enum audit_state state;
182 unsigned int serial; /* serial number for record */ 183 unsigned int serial; /* serial number for record */
@@ -517,7 +518,7 @@ static inline struct audit_context *audit_get_context(struct task_struct *tsk,
517 context->return_valid = return_valid; 518 context->return_valid = return_valid;
518 context->return_code = return_code; 519 context->return_code = return_code;
519 520
520 if (context->in_syscall && !context->auditable) { 521 if (context->in_syscall && !context->dummy && !context->auditable) {
521 enum audit_state state; 522 enum audit_state state;
522 523
523 state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_EXIT]); 524 state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_EXIT]);
@@ -1069,7 +1070,8 @@ void audit_syscall_entry(int arch, int major,
1069 context->argv[3] = a4; 1070 context->argv[3] = a4;
1070 1071
1071 state = context->state; 1072 state = context->state;
1072 if (state == AUDIT_SETUP_CONTEXT || state == AUDIT_BUILD_CONTEXT) 1073 context->dummy = !audit_n_rules;
1074 if (!context->dummy && (state == AUDIT_SETUP_CONTEXT || state == AUDIT_BUILD_CONTEXT))
1073 state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_ENTRY]); 1075 state = audit_filter_syscall(tsk, context, &audit_filter_list[AUDIT_FILTER_ENTRY]);
1074 if (likely(state == AUDIT_DISABLED)) 1076 if (likely(state == AUDIT_DISABLED))
1075 return; 1077 return;