]> git.baikalelectronics.ru Git - kernel.git/commit
blackfin/ptrace: call find_vma with the mmap_sem held
authorDavidlohr Bueso <davidlohr@hp.com>
Fri, 6 Jun 2014 21:38:10 +0000 (14:38 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Jun 2014 23:08:16 +0000 (16:08 -0700)
commita29eacfe514902e2e37e9bb0fc735c078135e20e
tree3e8dc9383920eb2c92c1820bfcebe1823cd8899e
parent94c3ac0b8a502119f246e1e2cbad3aacd2ddb027
blackfin/ptrace: 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.

Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
Cc: Steven Miao <realmz6@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/blackfin/kernel/ptrace.c