* [PATCH] fix oops in __audit_signal_info()
@ 2007-08-07 23:01 Al Viro
2007-08-08 1:22 ` James Morris
0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2007-08-07 23:01 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, stable
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>
---
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index a777d37..3401293 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1992,19 +1992,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) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix oops in __audit_signal_info()
2007-08-07 23:01 [PATCH] fix oops in __audit_signal_info() Al Viro
@ 2007-08-08 1:22 ` James Morris
0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2007-08-08 1:22 UTC (permalink / raw)
To: Al Viro; +Cc: Linus Torvalds, linux-kernel, stable
On Wed, 8 Aug 2007, Al Viro wrote:
> 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>
--
James Morris
<jmorris@namei.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-08 1:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-07 23:01 [PATCH] fix oops in __audit_signal_info() Al Viro
2007-08-08 1:22 ` James Morris
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®