Re: more signal locking bugs?

From: Linus Torvalds (torvalds@transmeta.com)
Date: Sun Feb 16 2003 - 14:42:56 EST


On Sun, 16 Feb 2003, Manfred Spraul wrote:
>
> ABBA is not a deadlock, because linux read_locks permit recursive calls.
>
> read_lock(tasklist_lock);
> task_lock(tsk);
> read_lock(tasklist_lock);
>
> Does not deadlock, nor any other ordering.
>
> The tasklist_lock is never taken for write from bh or irq context.

Doesn't matter.

        CPU1 - do_exit() CPU2 - non-nested task_lock()

                                                task_lock(tsk)
        write_lock_irq(&tasklist_lock); IRQ HAPPENS
        task_lock(tsk); read_lock(&tasklist_lock)

BOOM, you're dead.

See? ABBA _does_ happen with the task lock, it's just that the magic
required to do so is fairly unlikely thanks to the added requirement for
the irq to happen at just the right moment (ie there are no static
code-paths that can cause it).

                Linus

-
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/



This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:15 EST