diff options
Diffstat (limited to 'kernel/arch/sh')
-rw-r--r-- | kernel/arch/sh/include/asm/uaccess.h | 5 | ||||
-rw-r--r-- | kernel/arch/sh/include/asm/uaccess_64.h | 1 | ||||
-rw-r--r-- | kernel/arch/sh/mm/kmap.c | 2 |
3 files changed, 7 insertions, 1 deletions
diff --git a/kernel/arch/sh/include/asm/uaccess.h b/kernel/arch/sh/include/asm/uaccess.h index a49635c51..92ade79ac 100644 --- a/kernel/arch/sh/include/asm/uaccess.h +++ b/kernel/arch/sh/include/asm/uaccess.h @@ -151,7 +151,10 @@ copy_from_user(void *to, const void __user *from, unsigned long n) __kernel_size_t __copy_size = (__kernel_size_t) n; if (__copy_size && __access_ok(__copy_from, __copy_size)) - return __copy_user(to, from, __copy_size); + __copy_size = __copy_user(to, from, __copy_size); + + if (unlikely(__copy_size)) + memset(to + (n - __copy_size), 0, __copy_size); return __copy_size; } diff --git a/kernel/arch/sh/include/asm/uaccess_64.h b/kernel/arch/sh/include/asm/uaccess_64.h index c01376c76..ca5073dd4 100644 --- a/kernel/arch/sh/include/asm/uaccess_64.h +++ b/kernel/arch/sh/include/asm/uaccess_64.h @@ -24,6 +24,7 @@ #define __get_user_size(x,ptr,size,retval) \ do { \ retval = 0; \ + x = 0; \ switch (size) { \ case 1: \ retval = __get_user_asm_b((void *)&x, \ diff --git a/kernel/arch/sh/mm/kmap.c b/kernel/arch/sh/mm/kmap.c index ec29e14ec..bf25d7c79 100644 --- a/kernel/arch/sh/mm/kmap.c +++ b/kernel/arch/sh/mm/kmap.c @@ -36,6 +36,7 @@ void *kmap_coherent(struct page *page, unsigned long addr) BUG_ON(!test_bit(PG_dcache_clean, &page->flags)); + preempt_disable(); pagefault_disable(); idx = FIX_CMAP_END - @@ -64,4 +65,5 @@ void kunmap_coherent(void *kvaddr) } pagefault_enable(); + preempt_enable(); } |