aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 4ee49e86edde..14e2262c0a04 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1179,6 +1179,9 @@ static int copy_from_user_mmap_sem(void *dst, const void __user *src, size_t n)
1179{ 1179{
1180 int partial; 1180 int partial;
1181 1181
1182 if (!access_ok(VERIFY_READ, src, n))
1183 return -EFAULT;
1184
1182 pagefault_disable(); 1185 pagefault_disable();
1183 partial = __copy_from_user_inatomic(dst, src, n); 1186 partial = __copy_from_user_inatomic(dst, src, n);
1184 pagefault_enable(); 1187 pagefault_enable();
@@ -1387,6 +1390,11 @@ static long vmsplice_to_user(struct file *file, const struct iovec __user *iov,
1387 break; 1390 break;
1388 } 1391 }
1389 1392
1393 if (unlikely(!access_ok(VERIFY_WRITE, base, len))) {
1394 error = -EFAULT;
1395 break;
1396 }
1397
1390 sd.len = 0; 1398 sd.len = 0;
1391 sd.total_len = len; 1399 sd.total_len = len;
1392 sd.flags = flags; 1400 sd.flags = flags;