diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-09-15 12:22:42 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-09-15 20:49:33 -0400 |
commit | 886e3b7fe6054230c89ae078a09565ed183ecc73 (patch) | |
tree | 95978914331e3b9f4e2f22f7c645ec039f6d77aa | |
parent | 4be36ca0cefc09725f52a9590d061399d3e524d7 (diff) |
nfsd4: fix null dereference creating nfsv4 callback client
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.
Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r-- | fs/nfsd/nfs4callback.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 63bb384b4d5c..4abb88264c72 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -437,6 +437,7 @@ static struct rpc_cred *lookup_cb_cred(struct nfs4_cb_conn *cb) | |||
437 | struct auth_cred acred = { | 437 | struct auth_cred acred = { |
438 | .machine_cred = 1 | 438 | .machine_cred = 1 |
439 | }; | 439 | }; |
440 | struct rpc_auth *auth = cb->cb_client->cl_auth; | ||
440 | 441 | ||
441 | /* | 442 | /* |
442 | * Note in the gss case this doesn't actually have to wait for a | 443 | * Note in the gss case this doesn't actually have to wait for a |
@@ -444,8 +445,7 @@ static struct rpc_cred *lookup_cb_cred(struct nfs4_cb_conn *cb) | |||
444 | * non-uptodate cred which the rpc state machine will fill in with | 445 | * non-uptodate cred which the rpc state machine will fill in with |
445 | * a refresh_upcall later. | 446 | * a refresh_upcall later. |
446 | */ | 447 | */ |
447 | return rpcauth_lookup_credcache(cb->cb_client->cl_auth, &acred, | 448 | return auth->au_ops->lookup_cred(auth, &acred, RPCAUTH_LOOKUP_NEW); |
448 | RPCAUTH_LOOKUP_NEW); | ||
449 | } | 449 | } |
450 | 450 | ||
451 | void do_probe_callback(struct nfs4_client *clp) | 451 | void do_probe_callback(struct nfs4_client *clp) |