diff options
| author | James Morris <jmorris@namei.org> | 2008-08-28 10:47:34 +1000 |
|---|---|---|
| committer | James Morris <jmorris@namei.org> | 2008-08-28 10:47:34 +1000 |
| commit | 86d688984deefa3ae5a802880c11f2b408b5d6cf (patch) | |
| tree | 7ea5e8189b0a774626d3ed7c3c87df2495a4c4a0 /kernel/auditsc.c | |
| parent | 93c06cbbf9fea5d5be1778febb7fa9ab1a74e5f5 (diff) | |
| parent | 4c246edd2550304df5b766cc841584b2bb058843 (diff) | |
| download | lwn-86d688984deefa3ae5a802880c11f2b408b5d6cf.tar.gz lwn-86d688984deefa3ae5a802880c11f2b408b5d6cf.zip | |
Merge branch 'master' into next
Diffstat (limited to 'kernel/auditsc.c')
| -rw-r--r-- | kernel/auditsc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 496c3dd37276..972f8e61d36a 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -243,6 +243,9 @@ static inline int open_arg(int flags, int mask) static int audit_match_perm(struct audit_context *ctx, int mask) { + if (unlikely(!ctx)) + return 0; + unsigned n = ctx->major; switch (audit_classify_syscall(ctx->arch, n)) { case 0: /* native */ @@ -284,6 +287,10 @@ static int audit_match_filetype(struct audit_context *ctx, int which) { unsigned index = which & ~S_IFMT; mode_t mode = which & S_IFMT; + + if (unlikely(!ctx)) + return 0; + if (index >= ctx->name_count) return 0; if (ctx->names[index].ino == -1) |
