Re: [PATCH/RFC] Futex mmap_sem deadlock

Olof Johansson
2005-02-22T21:23:49Z

On Tue, Feb 22, 2005 at 09:07:52PM +0000, Jamie Lokier wrote:
>
> That won't work because the vma lock must be help between key
> calculation and get_user() - otherwise futex is not reliable. It
> would work if the futex key calculation was inside the loop.

Sure, but that's still true: It's just that the get_user() is done twice
instead. The semaphore is never released between the key calculation and
the "real" get_user().

> A much simpler solution (and sorry for not offering it earlier,
> because Andrew Morton pointed out this bug long ago, but I was busy), is:

Either way works for me. Andrew/Linus, got a preference? I'll either
post my refresh based on Andrews comments, or code up Jamie's
suggestion.

-Olof