From: "J. Bruce Fields" <bfields@fieldses.org>
To: andros@netapp.com
Cc: benny@panasas.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 0/3] NFSv4 callback pg_authenticate fix
Date: Wed, 17 Nov 2010 17:49:03 -0500 [thread overview]
Message-ID: <20101117224903.GC31009@fieldses.org> (raw)
In-Reply-To: <1289964990-4480-1-git-send-email-andros@netapp.com>
On Tue, Nov 16, 2010 at 10:36:27PM -0500, andros@netapp.com wrote:
> The back channel server svc_process_common RPC layer pg_authenticate call
> [nfs_callback_authenticate] is shared by both the NFSv4.0 and the NFSv4.1
> callback threads. It authenticates the incoming request by finding (and
> referencing) an nfs_client struct based on the incoming request address
> and the NFS version (4). This is akin to the NFS server which authenticates
> requests by matching the server address to the exports file client list.
>
> Since there is no minorversion in the search, it may find the wrong
> nfs_client struct.
What really matters to a sessions client is which connection the request
came over--if a server attempts to open a new connection back to a
client and send a 4.1 callback over it, it'd probably be best if the
client just refused that callback, even if it's from the right IP
address.
Would it be better to match cl_rpcclient->cl_xprt against rqstp->rq_xprt
somehow? (Or maybe just check that the port number matches as well as
the ip address?)
--b.
> For the nfsv4.0 callback service thread, this means it
> could find an NFSv4.1 nfs_client. For the NFSv4.1 callback service thread, it
> could find an NFSv4.0 instead of v4.1, or find an NFSv4.1 nfs_client with the
> wrong session.
>
> The nfs_client is dereferenced at the end of pg_authenticate. Another
> nfs_find_client call is done in the per operation dispatcher routines
> for NFSv4.0 and in the cb_sequence operation dispatcher routine for NFSv4.1
> after decoding.
>
> This means the callback server could start processing a callback, passing
> the pg_authenticate test, and have the nfs_client struct freed between the
> pg_authenticate call and the dispatcher operation call. Or, it could have
> found the wrong nfs_client in the pg_authenticate call.
>
> The current code has this behaviour: If the nfs_client is not found in
> pg_authenticate, the request is simply dropped (SVC_DROP). If an nfs_client
> is not found in the dispatcher routines NFS4ERR_BADSESSION is returned for
> v4.1 requests and NFS4ERR_BADHANDLE for v4.0 requests.
>
> The first patch fixes some of these issues. It adds a minorversion to the
> nfs_find_client routine which means that the NFSv4.0 back channel service always
> finds the correct nfs_client struct. The NFSv4.1 back channel service requires
> the sessionid from the CB_SEQUENCE operation to guarantee that the correct
> nfs_client struct is being used.
>
> The minorversion is assigned by checking for the existance of the
> bc_xprt field in the svc_rqst. This method of determining minorversion will
> work until we support stand alone back channels for NFSv4.1.
>
> The SVC_DROP return in pg_authenticate is changed to SVC_DENIED which sends
> an rpc auth error back to the caller. This matches nfsd which returns
> SVC_DENIED if there is no matching client address in the /etc/exports file.
> SVC_DROP is used for a memory allocation error.
>
> 0001-NFS-add-minorversion-to-nfs_find_client-search.patch
> 0002-SQUASHME-pnfs-submit-fix-highest-backchannel-slot-us.patch
>
> Both NFSv4.0 CB_RECALL and NFSv4.1 CB_LAYOUT_RECALL have been tested.
>
> This third patch is for comment only. It compiles but has not been tested.
> It returns SVC_DENIED if the dispatcher routines fail to find an
> nfs_client struct - replacing the NFS4ERR_BADSESSION and NFS4ERR_BADHANDLE
> currently returned. I'm not fully convinced that this is the behavior we want,
> comments appreciated.
>
> 0003-NFS-return-an-rpc-auth-error-on-back-channel.patch
>
> -->Andy
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2010-11-17 22:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-17 3:36 [PATCH 0/3] NFSv4 callback pg_authenticate fix andros
2010-11-17 3:36 ` [PATCH 1/3] NFS add minorversion to nfs_find_client search andros
2010-11-17 3:36 ` [PATCH 2/3] SQUASHME: pnfs-submit: fix highest backchannel slot used andros
2010-11-17 3:36 ` [PATCH 3/3] NFS return an rpc auth error on back channel andros
2010-11-17 23:26 ` Trond Myklebust
2010-11-18 14:42 ` William A. (Andy) Adamson
2010-11-18 15:05 ` Trond Myklebust
2010-11-18 15:08 ` William A. (Andy) Adamson
2010-11-17 23:10 ` [PATCH 1/3] NFS add minorversion to nfs_find_client search Trond Myklebust
2010-11-18 14:11 ` William A. (Andy) Adamson
2010-11-18 14:46 ` Trond Myklebust
2010-11-18 17:39 ` J. Bruce Fields
2010-11-17 22:49 ` J. Bruce Fields [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=20101117224903.GC31009@fieldses.org \
--to=bfields@fieldses.org \
--cc=andros@netapp.com \
--cc=benny@panasas.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).