]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - fs/splice.c
splice: move permission hook out of splice_file_to_pipe()
[thirdparty/kernel/linux.git] / fs / splice.c
index 6fc2c27e9520750100e1780b7f200b3034a916c2..d4fdd44c0b328054fb94262e95e6413804c10410 100644 (file)
@@ -1239,7 +1239,7 @@ long splice_file_to_pipe(struct file *in,
        pipe_lock(opipe);
        ret = wait_for_space(opipe, flags);
        if (!ret)
-               ret = vfs_splice_read(in, offset, opipe, len, flags);
+               ret = do_splice_read(in, offset, opipe, len, flags);
        pipe_unlock(opipe);
        if (ret > 0)
                wakeup_pipe_readers(opipe);
@@ -1316,6 +1316,10 @@ long do_splice(struct file *in, loff_t *off_in, struct file *out,
                        offset = in->f_pos;
                }
 
+               ret = rw_verify_area(READ, in, &offset, len);
+               if (unlikely(ret < 0))
+                       return ret;
+
                if (out->f_flags & O_NONBLOCK)
                        flags |= SPLICE_F_NONBLOCK;