From: Ralf Baechle Date: Wed, 9 Feb 2005 12:59:39 +0000 (+0000) Subject: Fix ptrace aliasing issue in copy_from_user_page / copy_to_user_page. X-Git-Tag: v2.6.15-rc1~731^2~1^2~306 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=26852d5cdb2bac01f2a48b815194a045e8a8e300;p=~emulex%2Finfiniband.git Fix ptrace aliasing issue in copy_from_user_page / copy_to_user_page. Signed-off-by: Ralf Baechle --- diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h index 635f1bfb403..3780c9f9354 100644 --- a/include/asm-mips/cacheflush.h +++ b/include/asm-mips/cacheflush.h @@ -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);