Re: Deadlock on the mm->mmap_sem

Andrea Arcangeli (andrea@suse.de)
Wed, 19 Sep 2001 14:49:47 +0200


On Wed, Sep 19, 2001 at 10:51:57AM +0100, David Howells wrote:
>
> Looking through the do_page_fault(), I noticed there's a race in expand stack
> because expand_stack() expects the caller to have the mm-sem write-locked.
>
> I've attached a patch that might fix it appropriately. Alternatively, it may
> be worth applying Andrea's 00_silent-stack-overflow-10 patch which fixes this
> and something else too.

Yep, it's here:

ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.10pre11aa1/00_silent-stack-overflow-10

I also added the documentation on the locking on top of expand_stack.

My patch also enforced a gap of one page (sysctl configurable in
with page granularity) between a growsdown vma and its previous vma, so
that we can more easily trap stack overflows on the heap. (such part
isn't related to the race fix but it was controversial but since it's
quite useful too I didn't splitted it out :)

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