diff options
author | Chetan C R <cravin@codeaurora.org> | 2018-05-15 18:08:38 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-05-29 21:58:34 -0700 |
commit | ad60f0e7355900da8ae3c1ab96a557dbc747b233 (patch) | |
tree | 672405149c03d10103815bcba7dc6e403e4b7cfc /kernel/auditsc.c | |
parent | addd4dab16dc4f3d186482c5a3d625f268ddb6b3 (diff) |
audit: Checks valid value of audit_signals and tsk->audit_context
There can be a case when current task's audit context
may be NULL or even if it is not NULL, it can have
invalid non-zero value of dummy variable and also
we should audit the signal only if we have non-zero
value of audit_signals.
Issue has been seen during power on/off tests. So
better to add explicit check on these variables.
Change-Id: I2f3e17d933fca8e3b8f4013f44f942f11c68f440
Signed-off-by: Chetan C R <cravin@codeaurora.org>
Diffstat (limited to 'kernel/auditsc.c')
-rw-r--r-- | kernel/auditsc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 6375465af0a7..b72f4f5616ac 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -2248,10 +2248,11 @@ int __audit_signal_info(int sig, struct task_struct *t) audit_sig_uid = uid; security_task_getsecid(tsk, &audit_sig_sid); } - if (!audit_signals || audit_dummy_context()) - return 0; } + if (!audit_signals || audit_dummy_context()) + return 0; + /* optimize the common case by putting first signal recipient directly * in audit_context */ if (!ctx->target_pid) { |