diff options
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 972f8e61d36a..cf5bc2f5f9c3 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -243,10 +243,11 @@ static inline int open_arg(int flags, int mask) | |||
243 | 243 | ||
244 | static int audit_match_perm(struct audit_context *ctx, int mask) | 244 | static int audit_match_perm(struct audit_context *ctx, int mask) |
245 | { | 245 | { |
246 | unsigned n; | ||
246 | if (unlikely(!ctx)) | 247 | if (unlikely(!ctx)) |
247 | return 0; | 248 | return 0; |
249 | n = ctx->major; | ||
248 | 250 | ||
249 | unsigned n = ctx->major; | ||
250 | switch (audit_classify_syscall(ctx->arch, n)) { | 251 | switch (audit_classify_syscall(ctx->arch, n)) { |
251 | case 0: /* native */ | 252 | case 0: /* native */ |
252 | if ((mask & AUDIT_PERM_WRITE) && | 253 | if ((mask & AUDIT_PERM_WRITE) && |
@@ -1203,13 +1204,13 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
1203 | (context->return_valid==AUDITSC_SUCCESS)?"yes":"no", | 1204 | (context->return_valid==AUDITSC_SUCCESS)?"yes":"no", |
1204 | context->return_code); | 1205 | context->return_code); |
1205 | 1206 | ||
1206 | mutex_lock(&tty_mutex); | 1207 | spin_lock_irq(&tsk->sighand->siglock); |
1207 | read_lock(&tasklist_lock); | ||
1208 | if (tsk->signal && tsk->signal->tty && tsk->signal->tty->name) | 1208 | if (tsk->signal && tsk->signal->tty && tsk->signal->tty->name) |
1209 | tty = tsk->signal->tty->name; | 1209 | tty = tsk->signal->tty->name; |
1210 | else | 1210 | else |
1211 | tty = "(none)"; | 1211 | tty = "(none)"; |
1212 | read_unlock(&tasklist_lock); | 1212 | spin_unlock_irq(&tsk->sighand->siglock); |
1213 | |||
1213 | audit_log_format(ab, | 1214 | audit_log_format(ab, |
1214 | " a0=%lx a1=%lx a2=%lx a3=%lx items=%d" | 1215 | " a0=%lx a1=%lx a2=%lx a3=%lx items=%d" |
1215 | " ppid=%d pid=%d auid=%u uid=%u gid=%u" | 1216 | " ppid=%d pid=%d auid=%u uid=%u gid=%u" |
@@ -1229,7 +1230,6 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts | |||
1229 | context->egid, context->sgid, context->fsgid, tty, | 1230 | context->egid, context->sgid, context->fsgid, tty, |
1230 | tsk->sessionid); | 1231 | tsk->sessionid); |
1231 | 1232 | ||
1232 | mutex_unlock(&tty_mutex); | ||
1233 | 1233 | ||
1234 | audit_log_task_info(ab, tsk); | 1234 | audit_log_task_info(ab, tsk); |
1235 | if (context->filterkey) { | 1235 | if (context->filterkey) { |