]> 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>
Mon, 19 May 2014 07:34:58 +0000 (17:34 +1000)
commit3bf19f7b8d023607dfce619a4cb08042922f36ab
treefe5927c7ff2e0377962b346cd20e3be7d7db9720
parenta548532789cd8d57a205287f0bfa3c8a1afa0d5c
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