1
0
Fork 0
alistair23-linux/net/sunrpc
Chuck Lever d41689a34a SUNRPC: Revert 241b1f419f ("SUNRPC: Remove xdr_buf_trim()")
commit 0a8e7b7d08 upstream.

I've noticed that when krb5i or krb5p security is in use,
retransmitted requests are missing the server's duplicate reply
cache. The computed checksum on the retransmitted request does not
match the cached checksum, resulting in the server performing the
retransmitted request again instead of returning the cached reply.

The assumptions made when removing xdr_buf_trim() were not correct.
In the send paths, the upper layer has already set the segment
lengths correctly, and shorting the buffer's content is simply a
matter of reducing buf->len.

xdr_buf_trim() is the right answer in the receive/unwrap path on
both the client and the server. The buffer segment lengths have to
be shortened one-by-one.

On the server side in particular, head.iov_len needs to be updated
correctly to enable nfsd_cache_csum() to work correctly. The simple
buf->len computation doesn't do that, and that results in
checksumming stale data in the buffer.

The problem isn't noticed until there's significant instability of
the RPC transport. At that point, the reliability of retransmit
detection on the server becomes crucial.

Fixes: 241b1f419f ("SUNRPC: Remove xdr_buf_trim()")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-05-20 08:20:39 +02:00
..
auth_gss SUNRPC: Revert 241b1f419f ("SUNRPC: Remove xdr_buf_trim()") 2020-05-20 08:20:39 +02:00
xprtrdma svcrdma: Fix leak of svc_rdma_recv_ctxt objects 2020-05-02 08:48:48 +02:00
Kconfig SUNRPC: Drop redundant CONFIG_ from CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES 2019-07-06 14:54:53 -04:00
Makefile SUNRPC: remove generic cred code. 2018-12-19 13:52:46 -05:00
addr.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
auth.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
auth_null.c SUNRPC: Add rpc_auth::au_ralign field 2019-02-14 11:48:36 -05:00
auth_unix.c SUNRPC: Use the client user namespace when encoding creds 2019-04-26 16:24:32 -04:00
backchannel_rqst.c SUNRPC: Destroy the back channel when we destroy the host transport 2019-10-30 12:04:35 -04:00
cache.c sunrpc: Fix potential leaks in sunrpc_cache_unhash() 2020-02-24 08:36:55 +01:00
clnt.c SUNRPC: Signalled ASYNC tasks need to exit 2020-05-20 08:20:24 +02:00
debugfs.c NFS client updates for Linux 5.3 2019-07-18 14:32:33 -07:00
netns.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rpc_pipe.c new helper: get_tree_keyed() 2019-09-05 14:34:22 -04:00
rpcb_clnt.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
sched.c SUNRPC: Avoid RPC delays when exiting suspend 2019-12-13 08:42:34 +01:00
socklib.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
stats.c Merge branch 'multipath_tcp' 2019-07-06 14:54:52 -04:00
sunrpc.h sunrpc: whitespace fixes 2018-07-31 12:53:40 -04:00
sunrpc_syms.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
svc.c sunrpc: clean up indentation issue 2019-09-25 11:13:12 -04:00
svc_xprt.c svcrdma: Fix leak of svc_rdma_recv_ctxt objects 2020-05-02 08:48:48 +02:00
svcauth.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
svcauth_unix.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
svcsock.c svcrdma: Fix leak of svc_rdma_recv_ctxt objects 2020-05-02 08:48:48 +02:00
sysctl.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
timer.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
xdr.c SUNRPC: Revert 241b1f419f ("SUNRPC: Remove xdr_buf_trim()") 2020-05-20 08:20:39 +02:00
xprt.c SUNRPC: Destroy the back channel when we destroy the host transport 2019-10-30 12:04:35 -04:00
xprtmultipath.c SUNRPC: Optimise transport balancing code 2019-07-18 14:43:52 -04:00
xprtsock.c SUNRPC: Fix backchannel RPC soft lockups 2020-04-29 16:33:18 +02:00