]> git.baikalelectronics.ru Git - kernel.git/commit
arc: call find_vma with the mmap_sem held
authorDavidlohr Bueso <davidlohr@hp.com>
Wed, 4 Jun 2014 23:07:29 +0000 (16:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jun 2014 23:54:00 +0000 (16:54 -0700)
commit1c835e36bad182daee2844a0cf08f5d409f9bfe0
tree5c7db141f650f8d427d9e8984d2b4ead9e266635
parent5408ab1b85f887159d3b4d30013fd9686fbb2fde
arc: call find_vma with the mmap_sem held

Performing vma lookups without taking the mm->mmap_sem is asking for
trouble.  While doing the search, the vma in question can be modified or
even removed before returning to the caller.  Take the lock (shared) in
order to avoid races while iterating through the vmacache and/or rbtree.

[akpm@linux-foundation.org: CSE current->active_mm, per Vineet]
Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arc/kernel/troubleshoot.c