linux/net/sunrpc
Chuck Lever 0a8e7b7d08 SUNRPC: Revert 241b1f419f ("SUNRPC: Remove xdr_buf_trim()")
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>
2020-04-27 10:58:30 -04:00
..
auth_gss SUNRPC: Revert 241b1f419f ("SUNRPC: Remove xdr_buf_trim()") 2020-04-27 10:58:30 -04:00
xprtrdma svcrdma: Fix leak of svc_rdma_recv_ctxt objects 2020-04-17 12:40:38 -04:00
addr.c SUNRPC: Use kmemdup_nul() in rpc_parse_scope_id() 2020-02-03 16:35:07 -05: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
auth.c SUNRPC: Remove broken gss_mech_list_pseudoflavors() 2020-01-15 10:54:32 -05: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/cache: Fix unsafe traverse caused double-free in cache_purge 2020-04-13 10:28:21 -04:00
clnt.c NFS client updates for Linux 5.7 2020-04-07 13:51:39 -07:00
debugfs.c NFS client updates for Linux 5.3 2019-07-18 14:32:33 -07: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
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 kernel/notifier.c: remove blocking_notifier_chain_cond_register() 2019-12-04 19:44:12 -08:00
rpcb_clnt.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
sched.c SUNRPC: Don't start a timer on an already queued rpc task 2020-04-04 19:59:27 -04:00
socklib.c SUNRPC: Refactor xs_sendpages() 2020-03-16 12:04:33 -04:00
socklib.h SUNRPC: Refactor xs_sendpages() 2020-03-16 12:04:33 -04:00
stats.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
sunrpc_syms.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
sunrpc.h SUNRPC: Teach server to use xprt_sock_sendmsg for socket sends 2020-03-16 12:04:33 -04:00
svc_xprt.c svcrdma: Fix leak of svc_rdma_recv_ctxt objects 2020-04-17 12:40:38 -04:00
svc.c SUNRPC: Teach server to use xprt_sock_sendmsg for socket sends 2020-03-16 12:04:33 -04:00
svcauth_unix.c nfsd: export upcalls must not return ESTALE when mountd is down 2020-03-16 12:04:33 -04:00
svcauth.c SUNRPC: Trace gssproxy upcall results 2019-10-30 16:32:07 -04:00
svcsock.c svcrdma: Fix leak of svc_rdma_recv_ctxt objects 2020-04-17 12:40:38 -04: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-04-27 10:58:30 -04:00
xprt.c svcrdma: Create a generic tracing class for displaying xdr_buf layout 2020-03-16 12:04:32 -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-17 12:40:31 -04:00