]> git.karo-electronics.de Git - karo-tx-linux.git/commit
m68k: call find_vma with the mmap_sem held in sys_cacheflush()
authorDavidlohr Bueso <davidlohr@hp.com>
Thu, 26 Jun 2014 00:42:44 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:44 +0000 (10:42 +1000)
commit9057f884660dcde8ec600c27cf7b489a01ead67e
tree3ed599dc1d257d2dccdd66f96c39b8a0e7729822
parentac47bff037bc8b3b70ada8ca3c4f99608b5a0027
m68k: call find_vma with the mmap_sem held in sys_cacheflush()

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: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/m68k/kernel/sys_m68k.c