diff options
author | Tom Tucker <tom@opengridcomputing.com> | 2008-05-13 10:16:05 -0400 |
---|---|---|
committer | Tom Tucker <tom@opengridcomputing.com> | 2008-05-19 08:34:02 -0400 |
commit | a6f911c04e20b98feb4b33d3aba2976851977d6a (patch) | |
tree | 54a34d7007ca8d1d39f55396e2d084f6f9310e91 /net/sunrpc | |
parent | 008fdbc57164b0ac237ad6ee2766944f02ac9c28 (diff) |
svcrdma: Verify read-list fits within RPCSVC_MAXPAGES
A RDMA read-list cannot contain more elements than RPCSVC_MAXPAGES or
it will overflow the DTO context. Verify this when processing the
protocol header.
Signed-off-by: Tom Tucker <tom@opengridcomputing.com>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index 6b16d8cd5682..06ab4841537b 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | |||
@@ -306,6 +306,8 @@ static int rdma_read_xdr(struct svcxprt_rdma *xprt, | |||
306 | ch_sge_ary = (struct chunk_sge *)tmp_ch_ctxt->sge; | 306 | ch_sge_ary = (struct chunk_sge *)tmp_ch_ctxt->sge; |
307 | 307 | ||
308 | svc_rdma_rcl_chunk_counts(ch, &ch_count, &byte_count); | 308 | svc_rdma_rcl_chunk_counts(ch, &ch_count, &byte_count); |
309 | if (ch_count > RPCSVC_MAXPAGES) | ||
310 | return -EINVAL; | ||
309 | sge_count = rdma_rcl_to_sge(xprt, rqstp, hdr_ctxt, rmsgp, | 311 | sge_count = rdma_rcl_to_sge(xprt, rqstp, hdr_ctxt, rmsgp, |
310 | sge, ch_sge_ary, | 312 | sge, ch_sge_ary, |
311 | ch_count, byte_count); | 313 | ch_count, byte_count); |