diff options
Diffstat (limited to 'kernel/ptrace.c')
-rw-r--r-- | kernel/ptrace.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 0d007d492..35fa9768d 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -10,6 +10,7 @@ #include <linux/sched.h> #include <linux/errno.h> #include <linux/mm.h> +#include <linux/bigmem.h> #include <asm/pgtable.h> #include <asm/uaccess.h> @@ -39,6 +40,8 @@ repeat: if (!pte_present(*pgtable)) goto fault_in_page; page = pte_page(*pgtable); + if (write && (!pte_write(*pgtable) || !pte_dirty(*pgtable))) + goto fault_in_page; if (MAP_NR(page) >= max_mapnr) return 0; flush_cache_page(vma, addr); @@ -50,7 +53,11 @@ repeat: dst = src; src = buf; } + src = (void *) kmap((unsigned long) src, KM_READ); + dst = (void *) kmap((unsigned long) dst, KM_WRITE); memcpy(dst, src, len); + kunmap((unsigned long) src, KM_READ); + kunmap((unsigned long) dst, KM_WRITE); } flush_page_to_ram(page); return len; |