diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2007-08-08 00:01:46 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-08-15 09:25:08 -0700 |
commit | 8adcb4c72176a326b61bbc0a7924d869e52cb116 (patch) | |
tree | 294eb9cd3e3ade6d245bc134dd5a01d1e2d26993 /kernel | |
parent | 0565dc16555165fbca080c2121bec74ec79f1fc5 (diff) |
fix oops in __audit_signal_info()
Check for audit_signals is misplaced and check for
audit_dummy_context() is missing; as the result, if we send
signal to auditd from task with NULL ->audit_context while
we have audit_signals != 0 we end up with an oops.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/auditsc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index e36481ed61b4..ea37eddc4386 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -1998,19 +1998,19 @@ int __audit_signal_info(int sig, struct task_struct *t) extern uid_t audit_sig_uid; extern u32 audit_sig_sid; - if (audit_pid && t->tgid == audit_pid && - (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1)) { - audit_sig_pid = tsk->pid; - if (ctx) - audit_sig_uid = ctx->loginuid; - else - audit_sig_uid = tsk->uid; - selinux_get_task_sid(tsk, &audit_sig_sid); + if (audit_pid && t->tgid == audit_pid) { + if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1) { + audit_sig_pid = tsk->pid; + if (ctx) + audit_sig_uid = ctx->loginuid; + else + audit_sig_uid = tsk->uid; + selinux_get_task_sid(tsk, &audit_sig_sid); + } + if (!audit_signals || audit_dummy_context()) + return 0; } - if (!audit_signals) /* audit_context checked in wrapper */ - return 0; - /* optimize the common case by putting first signal recipient directly * in audit_context */ if (!ctx->target_pid) { |