* [PATCH v1] svcrdma: Catch another Reply chunk overflow case
@ 2020-11-12 21:55 Chuck Lever
0 siblings, 0 replies; only message in thread
From: Chuck Lever @ 2020-11-12 21:55 UTC (permalink / raw)
To: linux-nfs, linux-rdma
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>
---
net/sunrpc/xprtrdma/svc_rdma_rw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/sunrpc/xprtrdma/svc_rdma_rw.c b/net/sunrpc/xprtrdma/svc_rdma_rw.c
index 12aa4c53b48f..0b63e1321d74 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_rw.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_rw.c
@@ -455,6 +455,8 @@ svc_rdma_build_writes(struct svc_rdma_write_info *info,
goto out_overflow;
write_len = min(remaining, seg->rs_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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-12 21:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 21:55 [PATCH v1] svcrdma: Catch another Reply chunk overflow case Chuck Lever
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).