lkml.org 
[lkml]   [2013]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRace in check_stack_guard_page?
I was looking at the stack expansion code, and I'm not convinced it's
safe. Aside from the obvious scariness of down_read(&mmap_sem) not
actually preventing vma changes, I think there's a real race. Suppose
that you have a VM_GROWSDOWN vma above a VM_GROWSUP vma with a
single-page gap between them. Suppose further that they have
different anon_vma roots.

If one ends up in expand_downwards and the other ends up in
expand_upwards at the same time, then each one can take
page_table_lock without re-checking that there's still room to expand.
The result will be two vmas that share a page.

(This is presumably only possible on ia64.)

--Andy


\
 
 \ /
  Last update: 2013-11-26 01:21    [W:0.037 / U:1.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site