linux/net/sunrpc
Sasha Levin 960994f5d1 xprtrdma: fix up the nfs/nfs-anna merge of the Write chunk head trim
Two fixes for the same Write chunk payload corruption meet in
linux-next. In the nfs tree, commit a0db57fee3 ("xprtrdma: Fix Write
chunk payload corruption on a short reply header") trims
head[0].iov_len in rpcrdma_decode_msg(). In the nfs-anna tree,
commit 9ee534a759 ("xprtrdma: trim head iovec when the payload
arrives via a Write chunk") trims it in rpcrdma_inline_fixup() and
reduces buflen by the same amount.

The merge resolution keeps the caller-side trim. By the time
rpcrdma_inline_fixup() runs, head[0].iov_len already equals copy_len,
so the block added by the nfs-anna commit never runs and its buflen
reduction in rq_rcv_buf and rq_private_buf is lost. The helper is also
still passed xdr_pad_size(writelist), while its kernel-doc now
describes @writelist as the number of bytes conveyed by the Write
chunk.

Drop the caller-side trim and pass the full Write chunk length, so
that rpcrdma_inline_fixup() is the only place that trims head[0] and
reduces buflen. Compute the pad with xdr_pad_size() in the helper, so
the padding from the nfs commit stays correct for lengths that are not
a multiple of four. Its rpclen calculation and empty reply check stay
in rpcrdma_decode_msg().

Fixes: 53ab189bdc14 ("Merge branch 'linux-next' of git://git.linux-nfs.org/projects/anna/linux-nfs.git")
Link: https://lore.kernel.org/all/as4aacUf2Q78FMvY@sirena.org.uk/
Signed-off-by: Sasha Levin <sashal@kernel.org>
Tested-by: Tim Menninger <tmenninger@everpuredata.com>
Reviewed-by: Tim Menninger <tmenninger@everpuredata.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-10-30 14:22:36 -10:00
..
auth_gss sunrpc: pin gss module across auth_domain RCU free 2026-10-04 21:15:29 -04:00
xprtrdma xprtrdma: fix up the nfs/nfs-anna merge of the Write chunk head trim 2026-10-30 14:22:36 -10:00
addr.c
auth_null.c
auth_tls.c
auth_unix.c
auth.c
backchannel_rqst.c SUNRPC: close backchannel before destroying callback service 2026-08-10 09:54:35 -04:00
cache.c SUNRPC: always drain cache_cleaner before destroying a cache_detail 2026-08-03 09:14:35 -04:00
clnt.c sunrpc: fix use-after-free in __rpc_clnt_handle_event and __rpc_clnt_remove_pipedir 2026-08-17 09:02:08 -07:00
debugfs.c
fail.h
Kconfig SUNRPC: Remove redundant crypto Kconfig dependencies 2026-06-09 16:32:59 -04:00
Makefile sunrpc: add a generic netlink family for cache upcalls 2026-06-01 11:08:18 -04:00
netlink.c NFSD: Put cache get-reqs dump attrs under reply 2026-06-01 11:08:18 -04:00
netlink.h sunrpc: add SUNRPC_CMD_CACHE_FLUSH netlink command 2026-06-01 11:08:18 -04:00
netns.h
rpc_pipe.c
rpcb_clnt.c SUNRPC: report local rpcbind calls that get no answer 2026-10-04 21:15:29 -04:00
sched.c
socklib.c
socklib.h
stats.c sunrpc: use per-net counts in svc_seq_show() 2026-08-10 09:54:35 -04:00
sunrpc_syms.c sunrpc: init gssp_lock before publishing proc entry 2026-08-10 09:54:35 -04:00
sunrpc.h
svc_xprt.c SUNRPC: allow a service to opt out of rpcbind registration 2026-10-11 23:11:53 -04:00
svc.c SUNRPC: allow a service to opt out of rpcbind registration 2026-10-11 23:11:53 -04:00
svcauth_unix.c sunrpc: honor the netlink unix_gid NEGATIVE flag 2026-10-04 21:15:29 -04:00
svcauth.c
svcsock.c NFSD 7.4 Release Notes 2026-10-25 15:12:41 -10:00
sysctl.c
sysfs.c sunrpc: fix uninitialized xprt_create_args structure 2026-06-08 12:06:41 -04:00
sysfs.h
timer.c
xdr.c SUNRPC: Carry a generated-codec context pointer in struct xdr_stream 2026-10-04 21:15:29 -04:00
xprt.c
xprtmultipath.c
xprtsock.c NFS Client Updates for Linux 7.4 2026-10-25 15:42:16 -10:00