splice: fix user pointer access in get_iovec_page_array()

Commit 8811930dc74a503415b35c4a79d14fb0b408a361 ("splice: missing user
pointer access verification") added the proper access_ok() calls to
copy_from_user_mmap_sem() which ensures we can copy the struct iovecs
from userspace to the kernel.

But we also must check whether we can access the actual memory region
pointed to by the struct iovec to fix the access checks properly.

Signed-off-by: Bastian Blank <waldi@debian.org>
Acked-by: Oliver Pinter <oliver.pntr@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Bastian Blank and committed by Linus Torvalds 712a30e6 25f66630

+1 -1
+1 -1
fs/splice.c
··· 1234 1234 if (unlikely(!len)) 1235 1235 break; 1236 1236 error = -EFAULT; 1237 - if (unlikely(!base)) 1237 + if (!access_ok(VERIFY_READ, base, len)) 1238 1238 break; 1239 1239 1240 1240 /*