aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/tipc/net.c
diff options
context:
space:
mode:
authorNeilBrown <neil@brown.name>2025-10-16 09:49:57 -0400
committerChuck Lever <chuck.lever@oracle.com>2025-11-10 09:31:52 -0500
commit1cff14b7fc7f31363c39d0269563ce75c714f7ae (patch)
treee3c3401652014f1b3ab0df507355abe9953e90eb /net/tipc/net.c
parentNFSD: Never cache a COMPOUND when the SEQUENCE operation fails (diff)
downloadwireguard-linux-1cff14b7fc7f31363c39d0269563ce75c714f7ae.tar.xz
wireguard-linux-1cff14b7fc7f31363c39d0269563ce75c714f7ae.zip
nfsd: ensure SEQUENCE replay sends a valid reply.
nfsd4_enc_sequence_replay() uses nfsd4_encode_operation() to encode a new SEQUENCE reply when replaying a request from the slot cache - only ops after the SEQUENCE are replayed from the cache in ->sl_data. However it does this in nfsd4_replay_cache_entry() which is called *before* nfsd4_sequence() has filled in reply fields. This means that in the replayed SEQUENCE reply: maxslots will be whatever the client sent target_maxslots will be -1 (assuming init to zero, and nfsd4_encode_sequence() subtracts 1) status_flags will be zero The incorrect maxslots value, in particular, can cause the client to think the slot table has been reduced in size so it can discard its knowledge of current sequence number of the later slots, though the server has not discarded those slots. When the client later wants to use a later slot, it can get NFS4ERR_SEQ_MISORDERED from the server. This patch moves the setup of the reply into a new helper function and call it *before* nfsd4_replay_cache_entry() is called. Only one of the updated fields was used after this point - maxslots. So the nfsd4_sequence struct has been extended to have separate maxslots for the request and the response. Reported-by: Olga Kornievskaia <okorniev@redhat.com> Closes: https://lore.kernel.org/linux-nfs/20251010194449.10281-1-okorniev@redhat.com/ Tested-by: Olga Kornievskaia <okorniev@redhat.com> Signed-off-by: NeilBrown <neil@brown.name> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'net/tipc/net.c')
0 files changed, 0 insertions, 0 deletions