summaryrefslogtreecommitdiffstats
path: root/kernel/arch/parisc/include/asm/uaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/parisc/include/asm/uaccess.h')
-rw-r--r--kernel/arch/parisc/include/asm/uaccess.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/arch/parisc/include/asm/uaccess.h b/kernel/arch/parisc/include/asm/uaccess.h
index 0abdd4c60..4ad514658 100644
--- a/kernel/arch/parisc/include/asm/uaccess.h
+++ b/kernel/arch/parisc/include/asm/uaccess.h
@@ -10,6 +10,7 @@
#include <asm-generic/uaccess-unaligned.h>
#include <linux/bug.h>
+#include <linux/string.h>
#define VERIFY_READ 0
#define VERIFY_WRITE 1
@@ -76,6 +77,7 @@ struct exception_table_entry {
*/
struct exception_data {
unsigned long fault_ip;
+ unsigned long fault_gp;
unsigned long fault_space;
unsigned long fault_addr;
};
@@ -244,13 +246,14 @@ static inline unsigned long __must_check copy_from_user(void *to,
unsigned long n)
{
int sz = __compiletime_object_size(to);
- int ret = -EFAULT;
+ unsigned long ret = n;
if (likely(sz == -1 || !__builtin_constant_p(n) || sz >= n))
ret = __copy_from_user(to, from, n);
else
copy_from_user_overflow();
-
+ if (unlikely(ret))
+ memset(to + (n - ret), 0, ret);
return ret;
}