From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: andros@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/5] nfs41: fix wrong error on callback decode hdr overflow
Date: Mon, 11 Jan 2010 18:08:39 -0500 [thread overview]
Message-ID: <1263251319.2663.6.camel@localhost> (raw)
In-Reply-To: <1262802213-2267-2-git-send-email-andros@netapp.com>
On Wed, 2010-01-06 at 13:23 -0500, andros@netapp.com wrote:
> From: Andy Adamson <andros@netapp.com>
>
> decode_op_hdr returns NFS4ERR_RESOURCE on decode buffer overflow which is
> correct for v4.0. Will fix the return for v4.1 along with all the other
> NFS4ERR_RESOURCE overflow errors in a later patch.
>
> Signed-off-by: Andy Adamson <andros@netapp.com>
> ---
> fs/nfs/callback_xdr.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
> index 8e1a251..e24487d 100644
> --- a/fs/nfs/callback_xdr.c
> +++ b/fs/nfs/callback_xdr.c
> @@ -605,17 +605,15 @@ static __be32 process_op(uint32_t minorversion, int nop,
> struct xdr_stream *xdr_out, void *resp)
> {
> struct callback_op *op = &callback_ops[0];
> - unsigned int op_nr = OP_CB_ILLEGAL;
> + unsigned int op_nr;
This will cause us to return a random op number in the case where the
buffer overflows.
> __be32 status;
> long maxlen;
> __be32 res;
>
> dprintk("%s: start\n", __func__);
> status = decode_op_hdr(xdr_in, &op_nr);
> - if (unlikely(status)) {
> - status = htonl(NFS4ERR_OP_ILLEGAL);
> + if (unlikely(status))
> goto out;
> - }
>
> dprintk("%s: minorversion=%d nop=%d op_nr=%u\n",
> __func__, minorversion, nop, op_nr);
The correct thing to do would appear to be rather to set
NFS4ERR_RESOURCE in the CB_COMPOUND return value, and simply not to
return an op here at all.
Trond
next prev parent reply other threads:[~2010-01-11 23:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-06 18:23 [PATCH 0/5] nfs41: return correct errors on callback replays andros
2010-01-06 18:23 ` [PATCH 1/5] nfs41: fix wrong error on callback decode hdr overflow andros
2010-01-06 18:23 ` [PATCH 2/5] nfs41: directly encode back channel error andros
2010-01-06 18:23 ` [PATCH 3/5] nfs41: remove uneeded checks in callback processing andros
2010-01-06 18:23 ` [PATCH 4/5] nfs41: prepare for back channel drc andros
2010-01-06 18:23 ` [PATCH 5/5] nfs41: back channel drc minimal implementation andros
2010-01-11 23:10 ` [PATCH 2/5] nfs41: directly encode back channel error Trond Myklebust
2010-01-11 23:08 ` Trond Myklebust [this message]
2010-01-12 17:38 ` [PATCH 1/5] nfs41: fix wrong error on callback decode hdr overflow Andy Adamson
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=1263251319.2663.6.camel@localhost \
--to=trond.myklebust@netapp.com \
--cc=andros@netapp.com \
--cc=linux-nfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).