All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] arm64: fix flush_cache_range
@ 2016-05-24 11:16 ` Zhen Lei
  0 siblings, 0 replies; 29+ messages in thread
From: Zhen Lei @ 2016-05-24 11:16 UTC (permalink / raw)
  To: linux-arm-kernel

When we ran mprotect04(a test case in LTP) infinitely, it would always
failed after a few seconds. The case can be described briefly that: copy
a empty function from code area into a new memory area(created by mmap),
then call mprotect to change the protection to PROT_EXEC. The syscall
sys_mprotect will finally invoke flush_cache_range, but this function
currently only invalid icache, the operation of flush dcache is missed.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 arch/arm64/mm/flush.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c
index dbd12ea..eda4124 100644
--- a/arch/arm64/mm/flush.c
+++ b/arch/arm64/mm/flush.c
@@ -31,7 +31,7 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start,
 		       unsigned long end)
 {
 	if (vma->vm_flags & VM_EXEC)
-		__flush_icache_all();
+		flush_icache_range(start, end);
 }

 static void sync_icache_aliases(void *kaddr, unsigned long len)
--
2.5.0

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2016-05-26 16:45 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-24 11:16 [PATCH 1/1] arm64: fix flush_cache_range Zhen Lei
2016-05-24 11:16 ` Zhen Lei
2016-05-24 11:37 ` Mark Rutland
2016-05-24 11:37   ` Mark Rutland
2016-05-24 12:19   ` Leizhen (ThunderTown)
2016-05-24 12:19     ` Leizhen (ThunderTown)
2016-05-24 13:02     ` Catalin Marinas
2016-05-24 13:02       ` Catalin Marinas
2016-05-25  1:20       ` Leizhen (ThunderTown)
2016-05-25  3:36         ` Leizhen (ThunderTown)
2016-05-25  3:36           ` Leizhen (ThunderTown)
2016-05-25 10:50           ` Catalin Marinas
2016-05-25 10:50             ` Catalin Marinas
2016-05-26  3:40             ` Leizhen (ThunderTown)
2016-05-26  3:40               ` Leizhen (ThunderTown)
2016-05-26 11:46             ` Leizhen (ThunderTown)
2016-05-26 11:46               ` Leizhen (ThunderTown)
2016-05-26 12:04               ` Russell King - ARM Linux
2016-05-26 12:04                 ` Russell King - ARM Linux
2016-05-26 16:36               ` Catalin Marinas
2016-05-26 16:36                 ` Catalin Marinas
2016-05-24 15:12     ` Mark Rutland
2016-05-24 15:12       ` Mark Rutland
2016-05-25 15:22       ` Catalin Marinas
2016-05-25 15:22         ` Catalin Marinas
2016-05-25 17:27         ` Russell King - ARM Linux
2016-05-25 17:27           ` Russell King - ARM Linux
2016-05-26 16:44           ` Catalin Marinas
2016-05-26 16:44             ` Catalin Marinas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.