Re: heavy handed exit() in latest BK

Ingo Molnar (mingo@elte.hu)
Sun, 9 Feb 2003 13:09:26 +0100 (CET)


On Sun, 9 Feb 2003, Roland McGrath wrote:

> > - a read_lock(&tasklist_lock) is missing around the group_send_sig_info()
> > in send_sig_info().
>
> Indeed. I still intend to clean up those entry points and haven't
> gotten to it, so I hadn't bothered with this yet either (though I think
> I sent it to you for the backport). It certainly does bite in practice,
> e.g. SIGPIPE.

it does bite - here's the correctness fix meanwhile, until the interface
is cleaned up.

Ingo

--- linux/kernel/signal.c.orig
+++ linux/kernel/signal.c
@@ -1083,17 +1083,19 @@
int
send_sig_info(int sig, struct siginfo *info, struct task_struct *p)
{
+ int ret;
+
/* XXX should nix these interfaces and update the kernel */
- if (T(sig, SIG_KERNEL_BROADCAST_MASK))
- /* XXX do callers really always hold the tasklist_lock?? */
- return group_send_sig_info(sig, info, p);
- else {
- int error;
+ if (T(sig, SIG_KERNEL_BROADCAST_MASK)) {
+ read_lock(&tasklist_lock);
+ ret = group_send_sig_info(sig, info, p);
+ read_unlock(&tasklist_lock);
+ } else {
spin_lock_irq(&p->sighand->siglock);
- error = specific_send_sig_info(sig, info, p);
+ ret = specific_send_sig_info(sig, info, p);
spin_unlock_irq(&p->sighand->siglock);
- return error;
}
+ return ret;
}

int

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/