From cd2567b6850b1648236a4aab0513a04ebaea6aa8 Mon Sep 17 00:00:00 2001 From: Davidlohr Bueso Date: Thu, 9 Oct 2014 15:29:45 -0700 Subject: [PATCH] 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. In addition, this guarantees that the address space will remain intact during the CPU flushing. Signed-off-by: Davidlohr Bueso Cc: Geert Uytterhoeven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-format-patch failed