linux-stable/include/linux/sunrpc
Chuck Lever 352cc3597b SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation
[ Upstream commit 90bfc37b5a ]

Ensure that stream-based argument decoding can't go past the actual
end of the receive buffer. xdr_init_decode's calculation of the
value of xdr->end over-estimates the end of the buffer because the
Linux kernel RPC server code does not remove the size of the RPC
header from rqstp->rq_arg before calling the upper layer's
dispatcher.

The server-side still uses the svc_getnl() macros to decode the
RPC call header. These macros reduce the length of the head iov
but do not update the total length of the message in the buffer
(buf->len).

A proper fix for this would be to replace the use of svc_getnl() and
friends in the RPC header decoder, but that would be a large and
invasive change that would be difficult to backport.

Fixes: 5191955d6f ("SUNRPC: Prepare for xdr_stream-style decoding on the server-side")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-21 12:38:01 +02:00
..
addr.h
auth.h
auth_gss.h
bc_xprt.h treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_149.RULE 2022-06-10 14:51:35 +02:00
cache.h SUNRPC: Make cache_req::thread_wait an unsigned long 2022-05-19 12:25:39 -04:00
clnt.h SUNRPC create a function that probes only offline transports 2022-07-25 10:06:04 -04:00
debug.h
gss_api.h
gss_asn1.h
gss_err.h
gss_krb5.h
gss_krb5_enctypes.h
metrics.h
msg_prot.h
rpc_pipe_fs.h
rpc_rdma.h
rpc_rdma_cid.h
sched.h SUNRPC: Shrink size of struct rpc_task 2022-07-23 14:47:28 -04:00
stats.h
svc.h SUNRPC: Fix svcxdr_init_decode's end-of-buffer calculation 2022-10-21 12:38:01 +02:00
svc_rdma.h
svc_rdma_pcl.h
svc_xprt.h
svcauth.h
svcauth_gss.h
svcsock.h
timer.h
types.h
xdr.h NFS client updates for Linux 5.20 2022-08-10 14:04:32 -07:00
xprt.h SUNRPC: Don't reuse bvec on retransmission of the request 2022-07-27 16:26:17 -04:00
xprtmultipath.h SUNRPC export xprt_iter_rewind function 2022-07-25 10:06:04 -04:00
xprtrdma.h
xprtsock.h