--- x/lib/iov_iter.c +++ y/lib/iov_iter.c @@ -1727,6 +1727,10 @@ static ssize_t iov_iter_extract_bvec_pag (*pages)[k++] = bv.bv_page; size += bv.bv_len; + if (size > maxsize) { + size = maxsize; + break; + } if (k >= maxpages) break;