linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Wed, 09 Feb 2005 12:59:45 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/02/09 12:59:39

Modified files:
        include/asm-mips: cacheflush.h 

Log message:
        Fix ptrace aliasing issue in copy_from_user_page / copy_to_user_page.

diff -urN linux/include/asm-mips/cacheflush.h 
linux/include/asm-mips/cacheflush.h
--- linux/include/asm-mips/cacheflush.h 2004/06/06 02:12:54     1.14
+++ linux/include/asm-mips/cacheflush.h 2005/02/09 12:59:39     1.15
@@ -56,11 +56,17 @@
 
 #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);

<Prev in Thread] Current Thread [Next in Thread>