m68k: Add missing mmap_read_lock() to sys_cacheflush()
PATCH 1/1 m68k: Add missing mmap_read_lock() to sys_cacheflush()
From: Liam Howlett <[email protected]>
[ 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 <[email protected]>
Reviewed-by Matthew Wilcox (Oracle) <[email protected]>
Signed-off-by Geert Uytterhoeven <[email protected]>
[ mmap_read_lock() open-coded using down_read() as was done prior to v5.8 ]
Signed-off-by Finn Thain <[email protected]>
--- arch/m68k/kernel/sys_m68k.c | 2 ++ 1 file changed, 2 insertions(+)
arch/m68k/kernel/sys_m68k.c +2 -0
@@ -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; + +down_read (¤t->mm->mmap_sem); }else {struct vm_area_struct *vma;
Hi!
Quoted 8 lines
From: Liam Howlett <[email protected]>
[ Upstream commit
f829b4b212a315b912cb23fd10aaf30534bb5ce9]When the superuser flushes the entire cache, the
mmap_read_lock()is not taken, butmmap_read_unlock()is called. Add the missingmmap_read_lock()call.
Quoted 7 lines
Fixes cd2567b6850b1648 ("m68k: call find_vma with the mmap_sem held in sys_cacheflush()")Signed-off-by Liam R. Howlett <[email protected]>Reviewed-by Matthew Wilcox (Oracle) <[email protected]>Signed-off-by Geert Uytterhoeven <[email protected]>[ mmap_read_lock() open-coded using down_read() as was done prior to v5.8 ]Signed-off-by Finn Thain <[email protected]>
Reviewed-by Pavel Machek <[email protected]>
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany