From: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: "Myklebust, Trond" <Trond.Myklebust@netapp.com>,
Weston Andros Adamson <dros@netapp.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] NFS: -EIO from decode_bitmap if too many bitmaps
Date: Fri, 15 Nov 2013 17:28:07 +0000 [thread overview]
Message-ID: <1384536486.4046.19.camel@leira.trondhjem.org> (raw)
In-Reply-To: <3D7E0A6D-4009-4B28-8B43-588631A8EFD4@oracle.com>
On Fri, 2013-11-15 at 12:23 -0500, Chuck Lever wrote:
> On Nov 15, 2013, at 12:10 PM, "Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:
>
> > On Fri, 2013-11-15 at 12:07 -0500, Chuck Lever wrote:
> >> On Nov 15, 2013, at 12:05 PM, "Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:
> >>
> >>> On Fri, 2013-11-15 at 12:00 -0500, Trond Myklebust wrote:
> >>>> On Fri, 2013-11-15 at 11:38 -0500, Weston Andros Adamson wrote:
> >>>>> decode_bitmap will only decode up to three bitmaps. If the xdr buffer
> >>>>> has more than three bitmaps, return -EIO here instead of bailing out in
> >>>>> a later xdr decode.
> >>>>>
> >>>>
> >>>> No. decode_bitmap will only _save_ 3 words in the bitmap[] argment, but
> >>>> it will decode arbitrary sized bitmaps:
> >>>>
> >>>> p = xdr_inline_decode(xdr, (bmlen << 2));
> >>>>
> >>>
> >>> That said, we should probably check that the server isn't setting those
> >>> bitmap words to any non-zero values. That would be a reason to return
> >>> EIO.
> >>
> >> Why wouldn't the client simply warn and ignore the extraneous data?
> >>
> >
> > ...because unless the GETATTR is the very last operation, we'd end up
> > failing to decode things correctly.
>
> Surely that's only if the returned bitmap length doesn't match the number of bitmap words returned. The server can return a properly encoded result without overwriting the next operation in the compound, can't it?
How do we know? You're already talking about a broken server.
> > Anyway, a server that returns
> > attributes that we haven't requested must clearly be borken. It's
> > definitely violating the spec.
>
> Definitely, but "be lenient in what you accept."
>
> The reason I bring this up is that we had exactly this problem with NFSv4.2, where the third bitmap word was added.
We've never had servers returning attributes that are not requested
AFAIK. In the current code, they are free to add in as many zero fillers
in the bitmap as they want, and that's exactly what we should be
accepting.
--
Trond Myklebust
Linux NFS client maintainer
NetApp
Trond.Myklebust@netapp.com
www.netapp.com
prev parent reply other threads:[~2013-11-15 17:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-15 16:38 [PATCH] NFS: -EIO from decode_bitmap if too many bitmaps Weston Andros Adamson
2013-11-15 16:57 ` Chuck Lever
2013-11-15 17:00 ` Trond Myklebust
2013-11-15 17:05 ` Myklebust, Trond
2013-11-15 17:07 ` Chuck Lever
2013-11-15 17:10 ` Myklebust, Trond
2013-11-15 17:22 ` Weston Andros Adamson
2013-11-15 17:23 ` Chuck Lever
2013-11-15 17:28 ` Myklebust, Trond [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=1384536486.4046.19.camel@leira.trondhjem.org \
--to=trond.myklebust@netapp.com \
--cc=chuck.lever@oracle.com \
--cc=dros@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).