]> git.karo-electronics.de Git - karo-tx-linux.git/commit
blackfin/ptrace: call find_vma with the mmap_sem held
authorDavidlohr Bueso <davidlohr@hp.com>
Sat, 17 May 2014 13:19:22 +0000 (23:19 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 20 May 2014 08:14:09 +0000 (18:14 +1000)
commitffbc77e4de5b1c0542b5666c70caa6069192c2f4
tree25e90fd3a381999155caffeb0a1430a2067bbcfb
parentf85cd2d1e3196b5f6bf67c42a7ec6e93760360e7
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>
arch/blackfin/kernel/ptrace.c