From: Al Viro Date: Sat, 2 Apr 2016 18:56:58 +0000 (-0400) Subject: do_splice_to(): cap the size before passing to ->splice_read() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=03cc0789a690eb9ab07070376252961caeae7441;p=openwrt%2Fstaging%2Fblogic.git do_splice_to(): cap the size before passing to ->splice_read() pipe capacity won't exceed 2G anyway. Signed-off-by: Al Viro --- 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