svcrdma: bound check rq_pages index in inline path

svc_rdma_copy_inline_range indexed rqstp->rq_pages[rc_curpage] without
verifying rc_curpage stays within the allocated page array. Add guards
before the first use and after advancing to a new page.

Fixes: d7cc73972661 ("svcrdma: support multiple Read chunks per RPC")
Cc: stable@vger.kernel.org
Signed-off-by: Joshua Rogers <linux@joshua.hu>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by Joshua Rogers and committed by Chuck Lever d1bea0ce 94972027

+3
+3
net/sunrpc/xprtrdma/svc_rdma_rw.c
··· 841 for (page_no = 0; page_no < numpages; page_no++) { 842 unsigned int page_len; 843 844 page_len = min_t(unsigned int, remaining, 845 PAGE_SIZE - head->rc_pageoff); 846
··· 841 for (page_no = 0; page_no < numpages; page_no++) { 842 unsigned int page_len; 843 844 + if (head->rc_curpage >= rqstp->rq_maxpages) 845 + return -EINVAL; 846 + 847 page_len = min_t(unsigned int, remaining, 848 PAGE_SIZE - head->rc_pageoff); 849