lkml.org 
[lkml]   [2009]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[067/136] nfsd4: fix null dereference creating nfsv4 callback client
    2.6.31-stable review patch.  If anyone has any objections, please let us know.

    ------------------
    From: J. Bruce Fields <bfields@citi.umich.edu>

    commit 886e3b7fe6054230c89ae078a09565ed183ecc73 upstream.

    On setting up the callback to the client, we attempt to use the same
    authentication flavor the client did. We find an rpc cred to use by
    calling rpcauth_lookup_credcache(), which assumes that the given
    authentication flavor has a credentials cache. However, this is not
    required to be true--in particular, auth_null does not use one.
    Instead, we should call the auth's lookup_cred() method.

    Without this, a client attempting to mount using nfsv4 and auth_null
    triggers a null dereference.

    Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    fs/nfsd/nfs4callback.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    --- a/fs/nfsd/nfs4callback.c
    +++ b/fs/nfsd/nfs4callback.c
    @@ -444,6 +444,7 @@ static struct rpc_cred *lookup_cb_cred(s
    struct auth_cred acred = {
    .machine_cred = 1
    };
    + struct rpc_auth *auth = cb->cb_client->cl_auth;

    /*
    * Note in the gss case this doesn't actually have to wait for a
    @@ -451,8 +452,7 @@ static struct rpc_cred *lookup_cb_cred(s
    * non-uptodate cred which the rpc state machine will fill in with
    * a refresh_upcall later.
    */
    - return rpcauth_lookup_credcache(cb->cb_client->cl_auth, &acred,
    - RPCAUTH_LOOKUP_NEW);
    + return auth->au_ops->lookup_cred(auth, &acred, RPCAUTH_LOOKUP_NEW);
    }

    void do_probe_callback(struct nfs4_client *clp)



    \
     
     \ /
      Last update: 2009-10-02 03:53    [W:2.695 / U:2.160 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site