Skip to content

Commit

Permalink
NFSD: fix decoding in nfs4_xdr_dec_cb_getattr
Browse files Browse the repository at this point in the history
If a client were to send an error to a CB_GETATTR call, the code
erronously continues to try decode past the error code. It ends
up returning BAD_XDR error to the rpc layer and then in turn
trigger a WARN_ONCE in nfsd4_cb_done() function.

Fixes: 6487a13 ("NFSD: add support for CB_GETATTR callback")
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
  • Loading branch information
Olga Kornievskaia authored and Chuck Lever committed Jan 6, 2025
1 parent 35e3464 commit 1b3e26a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ static int nfs4_xdr_dec_cb_getattr(struct rpc_rqst *rqstp,
return status;

status = decode_cb_op_status(xdr, OP_CB_GETATTR, &cb->cb_status);
if (status)
if (unlikely(status || cb->cb_seq_status))
return status;
if (xdr_stream_decode_uint32_array(xdr, bitmap, 3) < 0)
return -NFSERR_BAD_XDR;
Expand Down

0 comments on commit 1b3e26a

Please sign in to comment.