summaryrefslogtreecommitdiff
path: root/arch/m68k
diff options
context:
space:
mode:
authorLiam Howlett <liam.howlett@oracle.com>2021-04-07 23:00:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-14 10:50:19 +0300
commit58ee5a0de192f698b136128154b32773d946ec47 (patch)
treebfa80e87fe9f28bdbf161dd499c1b1cc9c553576 /arch/m68k
parent99d2fa2daf6da877e85c0ee8dd3a3a1fc4194b64 (diff)
downloadlinux-58ee5a0de192f698b136128154b32773d946ec47.tar.xz
m68k: Add missing mmap_read_lock() to sys_cacheflush()
[ Upstream commit f829b4b212a315b912cb23fd10aaf30534bb5ce9 ] When the superuser flushes the entire cache, the mmap_read_lock() is not taken, but mmap_read_unlock() is called. Add the missing mmap_read_lock() call. Fixes: cd2567b6850b1648 ("m68k: call find_vma with the mmap_sem held in sys_cacheflush()") Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Link: https://lore.kernel.org/r/20210407200032.764445-1-Liam.Howlett@Oracle.com Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/kernel/sys_m68k.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
index 1c235d8f53f3..f55bdcb8e4f1 100644
--- a/arch/m68k/kernel/sys_m68k.c
+++ b/arch/m68k/kernel/sys_m68k.c
@@ -388,6 +388,8 @@ sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len)
ret = -EPERM;
if (!capable(CAP_SYS_ADMIN))
goto out;
+
+ mmap_read_lock(current->mm);
} else {
struct vm_area_struct *vma;