]> 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>
Thu, 22 May 2014 00:54:30 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 30 May 2014 06:58:38 +0000 (16:58 +1000)
commitf9b5c4007af7b268879a67699c98d797c610c106
tree5291e92346bc149a3470e9a74c941f17ba543777
parentf5a5170fc4189b91121a7bfa39f3eef0eddcde35
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