diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2020-03-02 15:01:08 -0500 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2020-03-16 12:04:32 -0400 |
commit | e604aad2cac7357162f661e45f2f60e46faa7b17 (patch) | |
tree | 7f82e1ff6aac9128602ef6813bc4ce71792f7917 /include/linux/sunrpc/rpc_rdma.h | |
parent | svcrdma: Remove svcrdma_cm_event() trace point (diff) | |
download | linux-dev-e604aad2cac7357162f661e45f2f60e46faa7b17.tar.xz linux-dev-e604aad2cac7357162f661e45f2f60e46faa7b17.zip |
svcrdma: Use struct xdr_stream to decode ingress transport headers
The logic that checks incoming network headers has to be scrupulous.
De-duplicate: replace open-coded buffer overflow checks with the use
of xdr_stream helpers that are used most everywhere else XDR
decoding is done.
One minor change to the sanity checks: instead of checking the
length of individual segments, cap the length of the whole chunk
to be sure it can fit in the set of pages available in rq_pages.
This should be a better test of whether the server can handle the
chunks in each request.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'include/linux/sunrpc/rpc_rdma.h')
-rw-r--r-- | include/linux/sunrpc/rpc_rdma.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h index 92d182fd8e3b..320c672d84de 100644 --- a/include/linux/sunrpc/rpc_rdma.h +++ b/include/linux/sunrpc/rpc_rdma.h @@ -58,7 +58,8 @@ enum { enum { rpcrdma_fixed_maxsz = 4, rpcrdma_segment_maxsz = 4, - rpcrdma_readchunk_maxsz = 2 + rpcrdma_segment_maxsz, + rpcrdma_readseg_maxsz = 1 + rpcrdma_segment_maxsz, + rpcrdma_readchunk_maxsz = 1 + rpcrdma_readseg_maxsz, }; /* |