Skip to content

Commit a8ee909

Browse files
Joshua Rogerschucklever
authored andcommitted
svcrdma: use rc_pageoff for memcpy byte offset
svc_rdma_copy_inline_range added rc_curpage (page index) to the page base instead of the byte offset rc_pageoff. Use rc_pageoff so copies land within the current page. Found by ZeroPath (https://zeropath.com) Fixes: 8e12258 ("svcrdma: Move svc_rdma_read_info::ri_pageno to struct svc_rdma_recv_ctxt") Cc: stable@vger.kernel.org Signed-off-by: Joshua Rogers <linux@joshua.hu> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent d4b69a6 commit a8ee909

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/sunrpc/xprtrdma/svc_rdma_rw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ static int svc_rdma_copy_inline_range(struct svc_rqst *rqstp,
848848
head->rc_page_count++;
849849

850850
dst = page_address(rqstp->rq_pages[head->rc_curpage]);
851-
memcpy(dst + head->rc_curpage, src + offset, page_len);
851+
memcpy((unsigned char *)dst + head->rc_pageoff, src + offset, page_len);
852852

853853
head->rc_readbytes += page_len;
854854
head->rc_pageoff += page_len;

0 commit comments

Comments
 (0)