Skip to content

Commit 2a77c8d

Browse files
Joshua Rogersgregkh
authored andcommitted
svcrdma: use rc_pageoff for memcpy byte offset
commit a8ee909 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4846a4c commit 2a77c8d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/xprtrdma/svc_rdma_rw.c

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

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

856856
head->rc_readbytes += page_len;
857857
head->rc_pageoff += page_len;

0 commit comments

Comments
 (0)