From: Jeff Layton <jlayton@kernel.org>
To: cel@kernel.org, Neil Brown <neilb@suse.de>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH] NFSD: Fix CB_GETATTR status fix
Date: Mon, 10 Feb 2025 11:48:47 -0500 [thread overview]
Message-ID: <a11a2e04d1532565616f7b59a35da96bdd73e268.camel@kernel.org> (raw)
In-Reply-To: <20250210164331.113479-1-cel@kernel.org>
On Mon, 2025-02-10 at 11:43 -0500, cel@kernel.org wrote:
> From: Chuck Lever <chuck.lever@oracle.com>
>
> Jeff says:
>
> Now that I look, 1b3e26a5ccbf is wrong. The patch on the ml was correct, but
> the one that got committed is different. It should be:
>
> status = decode_cb_op_status(xdr, OP_CB_GETATTR, &cb->cb_status);
> if (unlikely(status || cb->cb_status))
>
> If "status" is non-zero, decoding failed (usu. BADXDR), but we also want to
> bail out and not decode the rest of the call if the decoded cb_status is
> non-zero. That's not happening here, cb_seq_status has already been checked and
> is non-zero, so this ends up trying to decode the rest of the CB_GETATTR reply
> when it doesn't exist.
>
> Reported-by: Jeff Layton: <jlayton@kernel.org>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219737
> Fixes: 1b3e26a5ccbf ("NFSD: fix decoding in nfs4_xdr_dec_cb_getattr")
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---
> fs/nfsd/nfs4callback.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
> index cf6d29828f4e..484077200c5d 100644
> --- a/fs/nfsd/nfs4callback.c
> +++ b/fs/nfsd/nfs4callback.c
> @@ -679,7 +679,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 (unlikely(status || cb->cb_seq_status))
> + if (unlikely(status || cb->cb_status))
> return status;
> if (xdr_stream_decode_uint32_array(xdr, bitmap, 3) < 0)
> return -NFSERR_BAD_XDR;
Reviewed-by: Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2025-02-10 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-10 16:43 [PATCH] NFSD: Fix CB_GETATTR status fix cel
2025-02-10 16:48 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a11a2e04d1532565616f7b59a35da96bdd73e268.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=dai.ngo@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox