diff options
author | Will Deacon <will.deacon@arm.com> | 2010-07-16 10:49:48 +0530 |
---|---|---|
committer | Ricardo Perez Olivares <x0081762@ti.com> | 2010-09-14 19:25:53 -0500 |
commit | c1032cb491bbdeea8df43aa11a5e8dee0e7e31c7 (patch) | |
tree | 9b237df7cadf6a1473b05cdc40c836ad2d45f19b /arch/arm/mm | |
parent | 42690f9cec3dd80547b4063eb8577df2bd0df0ee (diff) |
ARM: flush_ptrace_access: invalidate all I-caches
copy_to_user_page can be used by access_process_vm to write to an
executable page of a process using a mapping acquired by kmap.
For systems with I-cache aliasing, flushing the I-cache using the
Kernel mapping may leave stale data in the I-cache if the user
mapping is of a different colour.
This patch replaces the coherent_kern_range call in flush_ptrace_access
with a D-cache flush followed by a system-wide I-cache invalidation.
This is required on all systems where the size of a way in the I-cache
is larger than PAGE_SIZE.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/flush.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 53f83a7bbdf5..99ec00b0761f 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c @@ -119,8 +119,8 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page, /* VIPT non-aliasing cache */ if (vma->vm_flags & VM_EXEC) { - unsigned long addr = (unsigned long)kaddr; - __cpuc_coherent_kern_range(addr, addr + len); + __cpuc_flush_dcache_area(kaddr, len); + __flush_icache_all(); if (cache_ops_need_broadcast()) smp_call_function(flush_ptrace_access_other, NULL, 1); |