]> git.kernelconcepts.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>
Wed, 21 May 2014 07:11:29 +0000 (17:11 +1000)
commit18f194f2d13967f56ff4b6bdd7c8139d4dc6634c
tree945a239585d40a66ab29e2bd66e75374d662f9af
parent5caf96ef1c4cf9b887754656b704e78379f1066f
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