summaryrefslogtreecommitdiff
path: root/arch/alpha/lib/csum_partial_copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/lib/csum_partial_copy.c')
-rw-r--r--arch/alpha/lib/csum_partial_copy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/alpha/lib/csum_partial_copy.c b/arch/alpha/lib/csum_partial_copy.c
index 40736da9bea8..ffb19b7da999 100644
--- a/arch/alpha/lib/csum_partial_copy.c
+++ b/arch/alpha/lib/csum_partial_copy.c
@@ -338,6 +338,11 @@ csum_partial_copy_from_user(const void __user *src, void *dst, int len,
unsigned long doff = 7 & (unsigned long) dst;
if (len) {
+ if (!access_ok(VERIFY_READ, src, len)) {
+ *errp = -EFAULT;
+ memset(dst, 0, len);
+ return sum;
+ }
if (!doff) {
if (!soff)
checksum = csum_partial_cfu_aligned(