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>
This commit is contained in:
Al Viro 2016-04-02 14:56:58 -04:00
parent 7500c38ac3
commit 03cc0789a6
1 changed files with 3 additions and 0 deletions

View File

@ -1143,6 +1143,9 @@ static long do_splice_to(struct file *in, loff_t *ppos,
if (unlikely(ret < 0)) if (unlikely(ret < 0))
return ret; return ret;
if (unlikely(len > MAX_RW_COUNT))
len = MAX_RW_COUNT;
if (in->f_op->splice_read) if (in->f_op->splice_read)
splice_read = in->f_op->splice_read; splice_read = in->f_op->splice_read;
else else