]> git.baikalelectronics.ru Git - kernel.git/commit
svcrdma: Use struct xdr_stream to decode ingress transport headers
authorChuck Lever <chuck.lever@oracle.com>
Mon, 2 Mar 2020 20:01:08 +0000 (15:01 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Mar 2020 16:04:32 +0000 (12:04 -0400)
commit800c6e04748627a3336b689a5f088a07a29e95ff
tree7f82e1ff6aac9128602ef6813bc4ce71792f7917
parent92b76f5bb6152cc7eaa37a352d593df009dec436
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>
include/linux/sunrpc/rpc_rdma.h
include/linux/sunrpc/svc_rdma.h
include/trace/events/rpcrdma.h
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c