Commit 8adcb4c7 authored by Al Viro's avatar Al Viro Committed by Greg Kroah-Hartman

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
Acked-by: default avatarJames Morris <jmorris@namei.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0565dc16
...@@ -1998,19 +1998,19 @@ int __audit_signal_info(int sig, struct task_struct *t) ...@@ -1998,19 +1998,19 @@ int __audit_signal_info(int sig, struct task_struct *t)
extern uid_t audit_sig_uid; extern uid_t audit_sig_uid;
extern u32 audit_sig_sid; extern u32 audit_sig_sid;
if (audit_pid && t->tgid == audit_pid && if (audit_pid && t->tgid == audit_pid) {
(sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1)) { if (sig == SIGTERM || sig == SIGHUP || sig == SIGUSR1) {
audit_sig_pid = tsk->pid; audit_sig_pid = tsk->pid;
if (ctx) if (ctx)
audit_sig_uid = ctx->loginuid; audit_sig_uid = ctx->loginuid;
else else
audit_sig_uid = tsk->uid; audit_sig_uid = tsk->uid;
selinux_get_task_sid(tsk, &audit_sig_sid); 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 /* optimize the common case by putting first signal recipient directly
* in audit_context */ * in audit_context */
if (!ctx->target_pid) { if (!ctx->target_pid) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment