Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Fix ptrace aliasing issue in copy_from_user_page / copy_to_user_page.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

+7 -1
+7 -1
include/asm-mips/cacheflush.h
··· 55 55 56 56 #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 57 57 do { \ 58 + if (cpu_has_dc_aliases) \ 59 + flush_cache_page(vma, vaddr); \ 58 60 memcpy(dst, (void *) src, len); \ 59 61 flush_icache_page(vma, page); \ 60 62 } while (0) 61 63 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ 62 - memcpy(dst, src, len) 64 + do { \ 65 + if (cpu_has_dc_aliases) \ 66 + flush_cache_page(vma, vaddr); \ 67 + memcpy(dst, src, len); \ 68 + } while (0) 63 69 64 70 extern void (*flush_cache_sigtramp)(unsigned long addr); 65 71 extern void (*flush_icache_all)(void);