]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Fix ptrace aliasing issue in copy_from_user_page / copy_to_user_page.
authorRalf Baechle <ralf@linux-mips.org>
Wed, 9 Feb 2005 12:59:39 +0000 (12:59 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 29 Oct 2005 18:30:29 +0000 (19:30 +0100)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
include/asm-mips/cacheflush.h

index 635f1bfb403eca55410f208bbdd0c031e15a5a94..3780c9f9354aab6ace4c5ef126669ca070b16097 100644 (file)
@@ -55,11 +55,17 @@ extern void (*flush_icache_range)(unsigned long start, unsigned long end);
 
 #define copy_to_user_page(vma, page, vaddr, dst, src, len)             \
 do {                                                                   \
+       if (cpu_has_dc_aliases)                                         \
+               flush_cache_page(vma, vaddr);                           \
        memcpy(dst, (void *) src, len);                                 \
        flush_icache_page(vma, page);                                   \
 } while (0)
 #define copy_from_user_page(vma, page, vaddr, dst, src, len)           \
-       memcpy(dst, src, len)
+do {                                                                   \
+       if (cpu_has_dc_aliases)                                         \
+               flush_cache_page(vma, vaddr);                           \
+       memcpy(dst, src, len);                                          \
+} while (0)
 
 extern void (*flush_cache_sigtramp)(unsigned long addr);
 extern void (*flush_icache_all)(void);