summaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-04-02 20:56:58 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2016-04-04 01:52:59 +0200
commit03cc0789a690eb9ab07070376252961caeae7441 (patch)
tree571ea10fc6edaf214c0442494793a6635d05c045 /fs/splice.c
parentfix the braino in "namei: massage lookup_slow() to be usable by lookup_one_le... (diff)
downloadlinux-03cc0789a690eb9ab07070376252961caeae7441.tar.xz
linux-03cc0789a690eb9ab07070376252961caeae7441.zip
do_splice_to(): cap the size before passing to ->splice_read()
pipe capacity won't exceed 2G anyway. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 9947b5c69664..a6b87b7e0745 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1143,6 +1143,9 @@ static long do_splice_to(struct file *in, loff_t *ppos,
if (unlikely(ret < 0))
return ret;
+ if (unlikely(len > MAX_RW_COUNT))
+ len = MAX_RW_COUNT;
+
if (in->f_op->splice_read)
splice_read = in->f_op->splice_read;
else