diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-08-11 02:59:21 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-08-11 02:59:21 -0400 |
| commit | cf206bffbb7542df54043fad9898113172af99d8 (patch) | |
| tree | c7e7ca9a93443b888f98a0c07e74751a1aa3c947 /kernel/auditsc.c | |
| parent | c1955a3d4762e7a9bf84035eb3c4886a900f0d15 (diff) | |
| parent | 796aadeb1b2db9b5d463946766c5bbfd7717158c (diff) | |
Merge branch 'linus' into sched/clock
Diffstat (limited to 'kernel/auditsc.c')
| -rw-r--r-- | kernel/auditsc.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 4699950e65bd..972f8e61d36a 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
| @@ -243,6 +243,9 @@ 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 | if (unlikely(!ctx)) | ||
| 247 | return 0; | ||
| 248 | |||
| 246 | unsigned n = ctx->major; | 249 | unsigned n = ctx->major; |
| 247 | switch (audit_classify_syscall(ctx->arch, n)) { | 250 | switch (audit_classify_syscall(ctx->arch, n)) { |
| 248 | case 0: /* native */ | 251 | case 0: /* native */ |
| @@ -284,6 +287,10 @@ static int audit_match_filetype(struct audit_context *ctx, int which) | |||
| 284 | { | 287 | { |
| 285 | unsigned index = which & ~S_IFMT; | 288 | unsigned index = which & ~S_IFMT; |
| 286 | mode_t mode = which & S_IFMT; | 289 | mode_t mode = which & S_IFMT; |
| 290 | |||
| 291 | if (unlikely(!ctx)) | ||
| 292 | return 0; | ||
| 293 | |||
| 287 | if (index >= ctx->name_count) | 294 | if (index >= ctx->name_count) |
| 288 | return 0; | 295 | return 0; |
| 289 | if (ctx->names[index].ino == -1) | 296 | if (ctx->names[index].ino == -1) |
| @@ -610,7 +617,7 @@ static int audit_filter_rules(struct task_struct *tsk, | |||
| 610 | if (!result) | 617 | if (!result) |
| 611 | return 0; | 618 | return 0; |
| 612 | } | 619 | } |
| 613 | if (rule->filterkey) | 620 | if (rule->filterkey && ctx) |
| 614 | ctx->filterkey = kstrdup(rule->filterkey, GFP_ATOMIC); | 621 | ctx->filterkey = kstrdup(rule->filterkey, GFP_ATOMIC); |
| 615 | switch (rule->action) { | 622 | switch (rule->action) { |
| 616 | case AUDIT_NEVER: *state = AUDIT_DISABLED; break; | 623 | case AUDIT_NEVER: *state = AUDIT_DISABLED; break; |
| @@ -2375,7 +2382,7 @@ int __audit_signal_info(int sig, struct task_struct *t) | |||
| 2375 | struct audit_context *ctx = tsk->audit_context; | 2382 | struct audit_context *ctx = tsk->audit_context; |
| 2376 | 2383 | ||
| 2377 | if (audit_pid && t->tgid == audit_pid) { | 2384 | if (audit_pid && t->tgid == audit_pid) { |
| 2378 | if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1) { | 2385 | if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1 || sig == SIGUSR2) { |
| 2379 | audit_sig_pid = tsk->pid; | 2386 | audit_sig_pid = tsk->pid; |
| 2380 | if (tsk->loginuid != -1) | 2387 | if (tsk->loginuid != -1) |
| 2381 | audit_sig_uid = tsk->loginuid; | 2388 | audit_sig_uid = tsk->loginuid; |
