Skip to content

Commit

Permalink
svcrdma: Catch another Reply chunk overflow case
Browse files Browse the repository at this point in the history
When space in the Reply chunk runs out in the middle of a segment,
we end up passing a zero-length SGL to rdma_rw_ctx_init(), and it
oopses.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
Chuck Lever committed Nov 30, 2020
1 parent b650545 commit e5decb2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sunrpc/xprtrdma/svc_rdma_rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ svc_rdma_build_writes(struct svc_rdma_write_info *info,
offset += info->wi_seg_off;

write_len = min(remaining, length - info->wi_seg_off);
if (!write_len)
goto out_overflow;
ctxt = svc_rdma_get_rw_ctxt(rdma,
(write_len >> PAGE_SHIFT) + 2);
if (!ctxt)
Expand Down

0 comments on commit e5decb2

Please sign in to comment.